Skip to content

Commit

Permalink
fix(trivy): add Linux nodeAffinity to scan job in ClientServer mode (a…
Browse files Browse the repository at this point in the history
…quasecurity#769)

Resolves: aquasecurity#749

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak authored Oct 22, 2021
1 parent 76ec5d9 commit c1c93d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/plugin/trivy/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ func (p *plugin) getPodSpecForClientServerMode(config Config, spec corev1.PodSpe
}

return corev1.PodSpec{
Affinity: starboard.LinuxNodeAffinity(),
RestartPolicy: corev1.RestartPolicyNever,
AutomountServiceAccountToken: pointer.BoolPtr(false),
Containers: containers,
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/trivy/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ CVE-2019-1543`,
},
},
expectedJobSpec: corev1.PodSpec{
Affinity: starboard.LinuxNodeAffinity(),
RestartPolicy: corev1.RestartPolicyNever,
AutomountServiceAccountToken: pointer.BoolPtr(false),
Containers: []corev1.Container{
Expand Down Expand Up @@ -1632,6 +1633,7 @@ CVE-2019-1543`,
},
},
expectedJobSpec: corev1.PodSpec{
Affinity: starboard.LinuxNodeAffinity(),
RestartPolicy: corev1.RestartPolicyNever,
AutomountServiceAccountToken: pointer.BoolPtr(false),
Containers: []corev1.Container{
Expand Down Expand Up @@ -1817,6 +1819,7 @@ CVE-2019-1543`,
},
},
expectedJobSpec: corev1.PodSpec{
Affinity: starboard.LinuxNodeAffinity(),
RestartPolicy: corev1.RestartPolicyNever,
AutomountServiceAccountToken: pointer.BoolPtr(false),
Volumes: []corev1.Volume{
Expand Down

0 comments on commit c1c93d7

Please sign in to comment.