You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added scanJob.customVolumes and scanJob.customVolumesMount to trivy-operator cm.
% kubectl get cm trivy-operator -n trivy-system -o yaml |grep scanJob.customVolumes
scanJob.customVolumes: '[{"hostPath":{"path":"/run/containerd/containerd.sock","type":"Socket"},"name":"containerd-sock"}]'
scanJob.customVolumesMount: '[{"mountPath":"/opt/run/containerd/containerd.sock","name":"containerd-sock"}]'
After creating scan-vulnerabilityreport job I inspected container's volumeMounts and volumes, then I got the results that customVolumes were appended to volumes but customVolumesMount were not appended to container's volumeMounts.
What steps did you take and what happened:
I added
scanJob.customVolumes
andscanJob.customVolumesMount
to trivy-operator cm.After creating
scan-vulnerabilityreport
job I inspected container's volumeMounts and volumes, then I got the results thatcustomVolumes
were appended to volumes but customVolumesMount were not appended to container'svolumeMounts
.What did you expect to happen:
customVolumesMount
will be appended to container'svolumeMounts
.Anything else you would like to add:
It caused by below.
container
is a pass-by-value and this change doesn't affect the original array.https://github.com/aquasecurity/trivy-operator/blob/v0.22.0/pkg/vulnerabilityreport/builder.go#L168-L175
I will fix it and make PR.
Environment:
trivy-operator version
): v0.22.0kubectl version
): v1.29.6The text was updated successfully, but these errors were encountered: