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
In previous commits a divergence between the kube-builder markers to
define permissions and final Helm chart RBAC files have been detected.
And tests in place did not detect this issue. The reason we hadn't
spotted this before is that the missing get verb was being masked
because list/watch populates the controller-runtime client cache.
Therefore, Get() calls never reach the API server and RBAC is never
evaluated for that verb. Other verbs (create, update, delete, patch)
always hit the API server and would be caught. list/watch would crash
the controller since the informer cache can't start.
To allow e2e tests to spot this a new flag is added to the controller to
configure the Kubernetes client to disable cache. Therefore, all the
request goes directly to the control plane validationg the RBAC rules.
Signed-off-by: José Guilherme Vanz <jguilhermevanz@suse.com>
Assisted-by: Github Copilot
// DisableClientCache forces all calls to bypass the controller-runtime
75
+
// informer cache and go directly to the API server. This ensures RBAC is
76
+
// evaluated for every read operation, including the "get" verb which would
77
+
// otherwise be silently served from cache even if the permission is missing.
78
+
// Should only be enabled in test/debug environments as it increases API
79
+
// server load.
80
+
DisableClientCachebool
77
81
}
78
82
79
83
typeConfigurationstruct {
@@ -135,6 +139,8 @@ func main() {
135
139
"image-pull-secrets",
136
140
"",
137
141
"Comma-separated list of Secret names to use as imagePullSecrets on every policy-server Deployment. The secrets must exist in the deployments namespace.")
0 commit comments