Skip to content

Commit

Permalink
fix: fix check gcr service account (#2200)
Browse files Browse the repository at this point in the history
This address the pull requested merged #2108. but the check was getting the default value where the propery was missing
  • Loading branch information
vadimceb authored Aug 22, 2024
1 parent 0f84528 commit ac6de39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/plugins/trivy/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func GetPodSpecForStandaloneMode(ctx trivyoperator.PluginContext,
registryPasswordKey := fmt.Sprintf("%s.password", c.Name)
secretName := secret.Name
if CheckGcpCrOrPrivateRegistry(c.Image) &&
trivyoperator.GetDefaultConfig().GetScanJobUseGCRServiceAccount() {
ctx.GetTrivyOperatorConfig().GetScanJobUseGCRServiceAccount() {
createEnvandVolumeForGcr(&env, &volumeMounts, &volumes, &registryPasswordKey, &secretName)
} else {
env = append(env, corev1.EnvVar{
Expand Down
2 changes: 1 addition & 1 deletion pkg/trivyoperator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const (
KeyNodeCollectorVolumeMounts = "nodeCollector.volumeMounts"
KeyScanJobCustomVolumesMount = "scanJob.customVolumesMount"
KeyScanJobCustomVolumes = "scanJob.customVolumes"
KeyScanJobUseGCRServiceAccount = "scanJob.UseGCRServiceAccount"
KeyScanJobUseGCRServiceAccount = "scanJob.useGCRServiceAccount"

keyScanJobNodeSelector = "scanJob.nodeSelector"
keyScanJobAnnotations = "scanJob.annotations"
Expand Down

0 comments on commit ac6de39

Please sign in to comment.