From c256ebde8907fb0f7619c0720529c19de75fc656 Mon Sep 17 00:00:00 2001 From: Marco Ebert Date: Mon, 24 Oct 2022 14:27:46 +0200 Subject: [PATCH] Templates: Align hook annotations, namespaces & indention. --- CHANGELOG.md | 1 + .../admission-webhooks/job-patch/clusterrole.yaml | 14 +++++--------- .../job-patch/clusterrolebinding.yaml | 5 ++--- .../job-patch/job-createSecret.yaml | 3 +-- .../job-patch/job-patchWebhook.yaml | 3 +-- .../admission-webhooks/job-patch/psp.yaml | 3 +-- .../admission-webhooks/job-patch/role.yaml | 4 ++-- .../admission-webhooks/job-patch/rolebinding.yaml | 6 +++--- .../job-patch/serviceaccount.yaml | 3 +-- 9 files changed, 17 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 829a8e96..d6057ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s - Helpers: Rename `resource.default.name` to `ingress-nginx.fullname`. ([#356](https://github.com/giantswarm/nginx-ingress-controller-app/pull/356)) - Repository: Rename `master` to `main`. ([#357](https://github.com/giantswarm/nginx-ingress-controller-app/pull/357)) - Helpers: Rename `labels.common` to `ingress-nginx.labels`. ([#358](https://github.com/giantswarm/nginx-ingress-controller-app/pull/358)) +- Templates: Align hook annotations, namespaces & indention. ([#359](https://github.com/giantswarm/nginx-ingress-controller-app/pull/359)) ## [2.19.0] - 2022-10-17 diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrole.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrole.yaml index d7c96494..7eb57388 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrole.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrole.yaml @@ -5,8 +5,7 @@ metadata: name: {{ include "ingress-nginx.fullname" . }}-admission annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-2" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook @@ -19,13 +18,10 @@ rules: - get - update {{- if .Values.podSecurityPolicy.enabled }} - - apiGroups: - - extensions - resources: - - podsecuritypolicies - verbs: - - use + - apiGroups: ['extensions'] + resources: ['podsecuritypolicies'] + verbs: ['use'] resourceNames: - - {{ include "ingress-nginx.fullname" . }}-admission + - {{ include "ingress-nginx.fullname" . }}-admission {{- end }} {{- end }} diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrolebinding.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrolebinding.yaml index da59c068..4990fb1c 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrolebinding.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/clusterrolebinding.yaml @@ -5,8 +5,7 @@ metadata: name: {{ include "ingress-nginx.fullname" . }}-admission annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook @@ -17,5 +16,5 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "ingress-nginx.fullname" . }}-admission - namespace: {{ .Release.Namespace }} + namespace: {{ .Release.Namespace | quote }} {{- end }} diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-createSecret.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-createSecret.yaml index e63a6810..ca8b86f1 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-createSecret.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-createSecret.yaml @@ -6,8 +6,7 @@ metadata: namespace: {{ .Release.Namespace }} annotations: "helm.sh/hook": pre-install,pre-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-patchWebhook.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-patchWebhook.yaml index 85585f90..2b79ce70 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-patchWebhook.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/job-patchWebhook.yaml @@ -6,8 +6,7 @@ metadata: namespace: {{ .Release.Namespace }} annotations: "helm.sh/hook": post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "0" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/psp.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/psp.yaml index 097d7382..07c605ae 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/psp.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/psp.yaml @@ -6,8 +6,7 @@ metadata: name: {{ include "ingress-nginx.fullname" . }}-admission annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-3" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/role.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/role.yaml index 8571c8ec..9b083ee6 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/role.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/role.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ include "ingress-nginx.fullname" . }}-admission + namespace: {{ .Release.Namespace }} annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-2" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/rolebinding.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/rolebinding.yaml index 319248b2..edda07f5 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/rolebinding.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/rolebinding.yaml @@ -3,10 +3,10 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ include "ingress-nginx.fullname" . }}-admission + namespace: {{ .Release.Namespace }} annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook @@ -17,5 +17,5 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "ingress-nginx.fullname" . }}-admission - namespace: {{ .Release.Namespace }} + namespace: {{ .Release.Namespace | quote }} {{- end }} diff --git a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/serviceaccount.yaml b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/serviceaccount.yaml index 20b70d6d..1ff0f7f0 100644 --- a/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/serviceaccount.yaml +++ b/helm/nginx-ingress-controller-app/templates/admission-webhooks/job-patch/serviceaccount.yaml @@ -6,8 +6,7 @@ metadata: namespace: {{ .Release.Namespace }} annotations: "helm.sh/hook": pre-install,pre-upgrade,post-install,post-upgrade - "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded,hook-failed" - "helm.sh/hook-weight": "-2" + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded labels: {{- include "ingress-nginx.labels" . | nindent 4 }} app.kubernetes.io/component: admission-webhook