diff --git a/apps/cnspec/cmd/scan.go b/apps/cnspec/cmd/scan.go index 5432b3e9..de490025 100644 --- a/apps/cnspec/cmd/scan.go +++ b/apps/cnspec/cmd/scan.go @@ -245,6 +245,12 @@ func getCobraScanConfig(cmd *cobra.Command, runtime *providers.Runtime, cliRes * cliRes.Asset.Name = assetName } + platformID := viper.GetString("platform-id") + if platformID != "" && cliRes.Asset != nil { + log.Info().Str("platform-id", platformID).Msg("platform-id overridden by by user") + cliRes.Asset.PlatformIds = append(cliRes.Asset.PlatformIds, platformID) + } + traceId := viper.GetString("trace-id") if traceId != "" && cliRes.Asset != nil { cliRes.Asset.TraceId = traceId