diff --git a/.helmignore b/.helmignore index f72da3305333c2c1bbd8ebb596c4b092f6fa3617..e40aded5435ba4d39cba63f1e06e69785794841a 100644 --- a/.helmignore +++ b/.helmignore @@ -28,4 +28,5 @@ README.md *.tmproj .vscode/ config -tests/ \ No newline at end of file +tests/ +Makefile \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..920405845a943ba2fa7bfe3fbfc9b44b4151ec3e --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +.PHONY: fetch_crds all + +# https://github.com/prometheus-community/helm-charts/releases +VERSION ?= 13.0.2 + +CRDS_PATH = charts/crds/crds +URL = https://github.com/prometheus-community/helm-charts/releases/download/prometheus-operator-crds-$(VERSION)/prometheus-operator-crds-$(VERSION).tgz + +fetch_crds: + rm -rf ${CRDS_PATH}/*.yaml + curl -s -L -o - ${URL} | tar -C ${CRDS_PATH} --strip-components=4 -xzf - prometheus-operator-crds/charts/crds/templates + find ${CRDS_PATH} -type f -name '*.yaml' -exec sed -i '/{{- with .Values.annotations }}/d' {} + + find ${CRDS_PATH} -type f -name '*.yaml' -exec sed -i '/{{- toYaml . | nindent 4 }}/d' {} + + find ${CRDS_PATH} -type f -name '*.yaml' -exec sed -i '/{{- end }}/d' {} + + sed -i '/^ annotations:/a \ argocd.argoproj.io/sync-options: ServerSideApply=true' ${CRDS_PATH}/*.yaml + +all: fetch_crds