Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trivyOperator.scanJobCustomVolumesMount and scanJobCustomVolumes helm values don't work as expected #2263

Open
vrevelas opened this issue Sep 18, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@vrevelas
Copy link

vrevelas commented Sep 18, 2024

What steps did you take and what happened:

Installed trivy-operator 0.22.0 with helm chart version 0.24.1 with the following set in my values.yaml (copy-pasted and uncommented from the chart's default values)

trivyOperator:
  scanJobCustomVolumesMount:
   - name: var-lib-etcd
     mountPath: /var/lib/etcd
     readOnly: true
  scanJobCustomVolumes:
   - name: var-lib-etcd
     hostPath:
     path: /var/lib/etcd

The scan-vulnerabilityreport-* Jobs created do contain the custom volume, but it's been converted to an emptyDir. the custom volume mount is missing from both the container and the initContainer:

apiVersion: batch/v1
kind: Job
...
spec:
  template:
    spec:
      containers:
        - args:
...
          volumeMounts:
            - mountPath: /tmp
              name: tmp
            - mountPath: /tmp/scan
              name: scanresult
...
      initContainers:
        - args:
...
          volumeMounts:
            - mountPath: /tmp
              name: tmp
      volumes:
        - emptyDir: {}
          name: tmp
        - emptyDir: {}
          name: scanresult
        - emptyDir: {}
          name: var-lib-etcd

I don't see any relevant errors or warnings in the trivy-operator logs (grepped for "custom", "volume", and "mount", case-insensitive).

What did you expect to happen:
I expected the Job's var-lib-etcd volume to be a hostPath, and the container and initContainer volumeMounts to mount the var-lib-etcd volume.

Anything else you would like to add:
N/A

Environment:

  • Trivy-Operator version (use trivy-operator version): 0.22.0
  • Kubernetes version (use kubectl version): 1.28.7
  • OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc): Ubuntu 20.04
@vrevelas vrevelas added the kind/bug Categorizes issue or PR as related to a bug. label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant