[Bug] Installing as a lower privileged user in namespace-scoped mode fails due to OpenShift resources in generated Role #1331
Labels
bug
Something isn't working
help wanted
Extra attention is needed
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Describe the bug
This is closely related to #1330. Since a vanilla Kubernetes cluster does not have the OpenShift resource type
routes
, namespace-scoped installation as a user without cluster admin permissions fails due to trying to grant permissions in aRole
not currently held.Version
v5.5.2
To Reproduce
Steps to reproduce the behavior:
helm upgrade -i grafana-operator oci://ghcr.io/grafana-operator/helm-charts/grafana-operator --version v5.5.2 -n tester --set namespaceScope=true
Expected behavior
The install should succeed with a generated Role that does not contain these OpenShift resource types.
Suspect component/Location where the bug might be occurring
https://github.com/grafana-operator/grafana-operator/blob/921a4da76410b7d1cc56d31da14a03859dc688fb/deploy/helm/grafana-operator/templates/rbac.yaml#L207-L218
Screenshots
Output of a test installation:
Runtime (please complete the following information):
Additional context
This could possibly be solved by only creating the rules for the
routes
types if they exist in the cluster usingCapabilities.APIVersions.Has
: https://helm.sh/docs/chart_template_guide/builtin_objects/The text was updated successfully, but these errors were encountered: