Skip to content

Commit

Permalink
🧹allow users to override the platform id
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Dec 4, 2024
1 parent 7faffe7 commit 2e0bac1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/cnspec/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e0bac1

Please sign in to comment.