diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 1718ed35..5802421d 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -11,8 +11,7 @@ configMapGenerator: namespace: image-scanner literals: - SERVER=http://trivy.image-scanner.svc.cluster.local - # FIXME: The second skip path is needed since Trivy somehow removes leading parts from the actual path - - SKIP_FILES=/var/run/image-scanner/trivy,run/image-scanner/trivy + - SKIP_FILES=/run/image-scanner/trivy - TIMEOUT=30m generatorOptions: disableNameSuffixHash: true diff --git a/internal/controller/stas/testdata/scan-job/expected-scan-job.yaml b/internal/controller/stas/testdata/scan-job/expected-scan-job.yaml index fd42de3e..b7ad6a8b 100644 --- a/internal/controller/stas/testdata/scan-job/expected-scan-job.yaml +++ b/internal/controller/stas/testdata/scan-job/expected-scan-job.yaml @@ -51,7 +51,7 @@ spec: - rootfs - / command: - - /var/run/image-scanner/trivy + - /run/image-scanner/trivy env: - name: HOME value: /tmp @@ -90,7 +90,7 @@ spec: terminationMessagePath: /dev/termination-log terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - - mountPath: /var/run/image-scanner + - mountPath: /run/image-scanner name: image-scanner - mountPath: /tmp name: tmp @@ -101,7 +101,7 @@ spec: - cp - -v - /usr/local/bin/trivy - - /var/run/image-scanner/trivy + - /run/image-scanner/trivy image: aquasecurity/trivy imagePullPolicy: IfNotPresent name: trivy @@ -115,7 +115,7 @@ spec: terminationMessagePath: /dev/termination-log terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - - mountPath: /var/run/image-scanner + - mountPath: /run/image-scanner name: image-scanner restartPolicy: OnFailure schedulerName: default-scheduler diff --git a/internal/trivy/scan_job.go b/internal/trivy/scan_job.go index 51ddd488..0b276231 100644 --- a/internal/trivy/scan_job.go +++ b/internal/trivy/scan_job.go @@ -17,7 +17,7 @@ import ( ) const ( - FsScanSharedVolumeMountPath = "/var/run/image-scanner" + FsScanSharedVolumeMountPath = "/run/image-scanner" FsScanSharedVolumeName = "image-scanner" FsScanTrivyBinaryPath = FsScanSharedVolumeMountPath + "/trivy" JobNameSpecHashPartLength = 5