From 7935873746b5efd82e6f6e88deca10f613a328eb Mon Sep 17 00:00:00 2001 From: chillTschill Date: Sat, 26 Aug 2023 00:56:36 +0200 Subject: [PATCH] Fixes #1039, naming of clusterscoped resources (#1159) --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index b13580b2..154f9480 100644 --- a/Makefile +++ b/Makefile @@ -334,6 +334,14 @@ helm-chart-generate: kustomize helm kubectl-slice yq charts for file in charts/$(CHART_NAME)/raw-files/*rolebinding*; do\ $(YQ) -i '.subjects[0].namespace = "{{ .Release.Namespace }}"' $${file};\ done + # Correct .metadata.name for cluster scoped resources + cluster_scoped_files="charts/$(CHART_NAME)/raw-files/clusterrolebinding-awx-operator-proxy-rolebinding.yaml charts/$(CHART_NAME)/raw-files/clusterrole-awx-operator-metrics-reader.yaml charts/$(CHART_NAME)/raw-files/clusterrole-awx-operator-proxy-role.yaml";\ + for file in $${cluster_scoped_files}; do\ + $(YQ) -i '.metadata.name += "-{{ .Release.Name }}"' $${file};\ + done + + # Correct the reference for the clusterrolebinding + $(YQ) -i '.roleRef.name += "-{{ .Release.Name }}"' 'charts/$(CHART_NAME)/raw-files/clusterrolebinding-awx-operator-proxy-rolebinding.yaml' # move all custom resource definitions to crds folder mkdir charts/$(CHART_NAME)/crds mv charts/$(CHART_NAME)/raw-files/customresourcedefinition*.yaml charts/$(CHART_NAME)/crds/.