Skip to content

Commit

Permalink
Fix check gcr service account
Browse files Browse the repository at this point in the history
This address the pull requested merged aquasecurity#2108. but the check was getting the default value where the propery was missing
  • Loading branch information
v.cebotari committed Jul 26, 2024
1 parent c4de896 commit d641e9e
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 d641e9e

Please sign in to comment.