From 2e0bac186f839911f85a3aab553dec7393245a45 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 4 Dec 2024 12:38:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9allow=20users=20to=20override=20the?= =?UTF-8?q?=20platform=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/cnspec/cmd/scan.go | 6 ++++++ 1 file changed, 6 insertions(+) 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