diff --git a/.github/scripts/metrics-replace-annotation.sh b/.github/scripts/metrics-replace-annotation.sh deleted file mode 100755 index e13aa26663f..00000000000 --- a/.github/scripts/metrics-replace-annotation.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - - sed -i '/putAnnotation: metrics-operator/c\ - {{- with .Values.global.caInjectionAnnotations }}\ - {{- toYaml . | nindent 4 }}\ - {{- end }}\ - {{- include "common.annotations" ( dict "context" . ) }}' chart/templates/metricsOperator-crd.yaml - -sed -i "/env: fake/c\\ - cert-manager.io\\/inject-ca-from: '{{ .Release.Namespace }}\\/keptn-certs'" chart/templates/metricsOperator-crd.yaml - -sed -i '/putLabels: newLabel/c\ -{{- include \"common.labels.standard\" (dict \"context\" .) | nindent 4 }}' chart/templates/metricsOperator-crd.yaml \ No newline at end of file diff --git a/.github/scripts/operator-replace-annotation.sh b/.github/scripts/operator-replace-annotation.sh deleted file mode 100755 index ca19104d67e..00000000000 --- a/.github/scripts/operator-replace-annotation.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - - sed -i "/env: fake/c\\ - cert-manager.io\\/inject-ca-from: '{{ .Release.Namespace }}\\/keptn-certs'\\ - {{- include \"common.annotations\" (dict \"context\" .) }}" chart/templates/operator-crd.yaml - -awk '/putAnnotation: operator/ && !found { found=1; next } 1' chart/templates/operator-crd.yaml > chart/templates/temp && mv chart/templates/temp chart/templates/operator-crd.yaml - -sed -i '/putAnnotation: operator/c\ - {{- with .Values.global.caInjectionAnnotations }}\ - {{- toYaml . | nindent 4 }}\ - {{- end }}\ - {{- include "common.annotations" ( dict "context" . ) }}' chart/templates/operator-crd.yaml - -sed -i '/putLabels: newLabel/c\ -{{- include \"common.labels.standard\" (dict \"context\" .) | nindent 4 }}' chart/templates/operator-crd.yaml - - - - - - diff --git a/lifecycle-operator/Makefile b/lifecycle-operator/Makefile index 0bd19469fb0..f774f174477 100644 --- a/lifecycle-operator/Makefile +++ b/lifecycle-operator/Makefile @@ -254,6 +254,9 @@ lint: ##command to update chart/templates and docs .PHONY: update-helmcharts -update-helmcharts: +update-helmcharts: generate manifests kustomize build config/crd > chart/templates/operator-crd.yaml - ./../.github/scripts/operator-replace-annotation.sh \ No newline at end of file + awk '/env: fake/ { print " cert-manager.io/inject-ca-from: '\''{{ .Release.Namespace }}/keptn-certs'\''"; print " {{- include \"common.annotations\" (dict \"context\" .) }}"; next } { print }' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml + awk '/putAnnotation: operator/ && !found { found=1; next } 1' chart/templates/operator-crd.yaml > chart/templates/temp && mv chart/templates/temp chart/templates/operator-crd.yaml + awk '/putAnnotation: operator/{print " {{- with .Values.global.caInjectionAnnotations }}"; print " {{- toYaml . | nindent 4 }}"; print " {{- end }}"; print " {{- include \"common.annotations\" ( dict \"context\" . ) }}"; next} 1' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml + awk '/putLabels: newLabel/{print "{{- include \"common.labels.standard\" (dict \"context\" .) | nindent 4 }}"; next} 1' chart/templates/operator-crd.yaml > temp_file && mv temp_file chart/templates/operator-crd.yaml \ No newline at end of file diff --git a/metrics-operator/Makefile b/metrics-operator/Makefile index 513a29619bf..97d70db002a 100644 --- a/metrics-operator/Makefile +++ b/metrics-operator/Makefile @@ -217,6 +217,9 @@ lint: ##command to update chart/templates and docs .PHONY: update-helmcharts -update-helmcharts: +update-helmcharts: generate manifests kustomize build config/crd > chart/templates/metricsOperator-crd.yaml - ./../.github/scripts/metrics-replace-annotation.sh + awk '/putAnnotation: metrics-operator/{print " {{- with .Values.global.caInjectionAnnotations }}"; print " {{- toYaml . | nindent 4 }}"; print " {{- end }}"; print " {{- include \"common.annotations\" ( dict \"context\" . ) }}"; next} 1' chart/templates/metricsOperator-crd.yaml > temp_file && mv temp_file chart/templates/metricsOperator-crd.yaml + awk '/env: fake/ {print " cert-manager.io/inject-ca-from: '\''{{ .Release.Namespace }}/keptn-certs'\''"; next} 1' chart/templates/metricsOperator-crd.yaml > temp_file && mv temp_file chart/templates/metricsOperator-crd.yaml + awk '/putLabels: newLabel/ {print "{{- include \"common.labels.standard\" (dict \"context\" .) | nindent 4 }}"; next} 1' chart/templates/metricsOperator-crd.yaml > temp_file && mv temp_file chart/templates/metricsOperator-crd.yaml +