faas-netes icon indicating copy to clipboard operation
faas-netes copied to clipboard

Remove role for Profile-CRD from chart

Open ArcticXWolf opened this issue 4 years ago • 0 comments

Followup on #696. Now that we can disable the creation of the CRDs in the helm chart, we can also move the creation of the roles for the Profiles CRD behind the toggle, as they are not needed if the CRD does not exist.

Expected Behaviour

If I disable the creation of the CRDs in the helm chart, I expect the chart to not create roles and role-bindings concerning the non-existing CRDs.

Current Behaviour

The chart creates the roles in all cases, if the CRDs are created or not.

Possible Solution

Wrap the following lines inside a {{- if .Values.createCRDs }} ... {{- end}} block: https://github.com/openfaas/faas-netes/blob/08ffc578d054f407458a6279c31216d6155ef7da/chart/openfaas/templates/controller-rbac.yaml#L76-L83 https://github.com/openfaas/faas-netes/blob/08ffc578d054f407458a6279c31216d6155ef7da/chart/openfaas/templates/controller-rbac.yaml#L184-L204 https://github.com/openfaas/faas-netes/blob/08ffc578d054f407458a6279c31216d6155ef7da/chart/openfaas/templates/controller-rbac.yaml#L205-L224

Context / Usecase

Without this change, users that have to skip creating the CRDs due to access rights might not be able to install the chart. For example I cannot create the role {{ .Release.Name }}-profiles and thus cannot install the chart.

ArcticXWolf avatar Nov 04 '20 10:11 ArcticXWolf