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

Missing volumeMounts for /tmp in OLM package #2244

Open
rascasoft opened this issue Aug 29, 2024 · 1 comment
Open

Missing volumeMounts for /tmp in OLM package #2244

rascasoft opened this issue Aug 29, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@rascasoft
Copy link

What steps did you take and what happened:

In recent versions (for sure 0.22.0 and 0.21.*) there's a problem related to the OLM installation of the operator, that prevents everything from working properly:

{"level":"error","ts":"2024-08-29T13:53:06Z","logger":"policyLoader.Get misconfig bundle policies","msg":"failed to load policies","error":"failed to download policies: failed to download built-in policies: download error: oci download error: failed to create a temp dir: mkdir /tmp/trivy730842185: read-only file system","stacktrace":"github.com/aquasecurity/trivy-operator/pkg/policy.(*policyLoader).GetPolicies\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/policy/loader.go:61\ngithub.com/aquasecurity/trivy-operator/pkg/policy.(*Policies).loadPolicies\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/policy/policy.go:144\ngithub.com/aquasecurity/trivy-operator/pkg/policy.(*Policies).Hash\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/policy/policy.go:114\ngithub.com/aquasecurity/trivy-operator/pkg/configauditreport/controller.(*ResourceController).SetupWithManager.(*ResourceController).reconcileResource.func1\n\t/home/runner/work/trivy-operator/trivy-operator/pkg/configauditreport/controller/resource.go:208\nsigs.k8s.io/controller-runtime/pkg/reconcile.Func.Reconcile\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/reconcile/reconcile.go:113\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:261\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:222"}

This is caused by the fact that the trivy-operator Pod in the deployment does not have the proper /tmp directory configuration:

          volumeMounts:
            - mountPath: /tmp
              name: cache-policies
              readOnly: false
      volumes:
        - emptyDir: {}
          name: cache-policies

This is part of the static installation file, but does not come when you install everything via OLM.

Note that this does not happen when using a previous version like 0.17.1.

What did you expect to happen:

Same behavior as the static file.

Environment:

  • Trivy-Operator version (use trivy-operator version): v0.22.0 (but this applies for sure on v0.21.*) and not on v0.17.1.
  • Kubernetes version (use kubectl version): v1.30.4
  • OS (macOS 10.15, Windows 10, Ubuntu 19.10 etc): AlmaLinux release 9.4 (Seafoam Ocelot)
@rascasoft rascasoft added the kind/bug Categorizes issue or PR as related to a bug. label Aug 29, 2024
Copy link

This issue is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Oct 29, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@afdesk afdesk reopened this Nov 18, 2024
@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Nov 19, 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

2 participants