From 9ff63e9f40519abe225af7f09f9f71ae0bba0ed6 Mon Sep 17 00:00:00 2001 From: Erica Hinkle Date: Mon, 27 Jul 2026 12:16:47 -0400 Subject: [PATCH] UPSTREAM: : OCPBUGS-89330: Change default cache path to avoid /var/cache/dnf conflict The default cache path was /var/cache, which caused chmod failures when running as non-root (UID 1001) because the RHEL base image contains /var/cache/dnf owned by root. EnsureEmptyDirectory() attempts to chmod entries in the cache directory to make them writable before deletion, but non-root users cannot chmod root-owned directories, resulting in: 'chmod /var/cache/dnf: operation not permitted' Fix: Change default from /var/cache to /var/cache/operator-controller to avoid conflicts with system directories in the base image. --- cmd/operator-controller/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/operator-controller/main.go b/cmd/operator-controller/main.go index b017927a3..2fcea83ef 100644 --- a/cmd/operator-controller/main.go +++ b/cmd/operator-controller/main.go @@ -181,7 +181,7 @@ func init() { flags.BoolVar(&cfg.enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") - flags.StringVar(&cfg.cachePath, "cache-path", "/var/cache", "The local directory path used for filesystem based caching") + flags.StringVar(&cfg.cachePath, "cache-path", "/var/cache/operator-controller", "The local directory path used for filesystem based caching") flags.StringVar(&cfg.systemNamespace, "system-namespace", "", "Configures the namespace that gets used to deploy system resources.") flags.StringVar(&cfg.globalPullSecret, "global-pull-secret", "", "The / of the global pull secret that is going to be used to pull bundle images.")