Skip to content

Commit

Permalink
feat: enabled ability to set instance type for scan
Browse files Browse the repository at this point in the history
Enabled the ability to set the instance at the scan level rather than
using the instance that was used for building. This allows a non-GPU
instance to do the scan.
  • Loading branch information
drew-viles committed Sep 5, 2023
1 parent 3cfdbcf commit 73893ad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/util/flags/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ func (o *ScanOptions) SetOptionsFromViper() {
o.OpenStackFlags.SetOptionsFromViper()
o.S3Flags.SetOptionsFromViper()

// We can override the value of the instance at the scan level
// This isn't available in the flags as it's already a flag that's available. This is viper only.
instance := viper.GetString(fmt.Sprintf("%s.flavor-name", viperScanPrefix))
if instance != "" {
o.FlavorName = instance
}
o.AddPause = viper.GetBool(fmt.Sprintf("%s.add-pause", viperOpenStackPrefix))
o.ImageID = viper.GetString(fmt.Sprintf("%s.image-id", viperScanPrefix))
o.AutoDeleteImage = viper.GetBool(fmt.Sprintf("%s.auto-delete-image", viperScanPrefix))
Expand Down

0 comments on commit 73893ad

Please sign in to comment.