From 2bc93f2a5919ba954b3077bd3a8a36b16981fa37 Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk Date: Fri, 10 Jan 2025 19:56:20 -0600 Subject: [PATCH] fix the annotations --- charts/operator-wandb/values.yaml | 3 +++ charts/wandb-base/templates/role.yaml | 4 ++++ charts/wandb-base/templates/rolebinding.yaml | 4 ++++ charts/wandb-base/templates/serviceaccount.yaml | 10 ++++++++-- charts/wandb-base/values.yaml | 2 ++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 9f34f125..446a49ab 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -798,6 +798,9 @@ settingsMigrationHook: "{{ .Release.Name }}-bucket-configmap": "configMapRef" "{{ .Release.Name }}-bucket": "secretRef" kind: Job + helmHookAnnotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-delete-policy": before-hook-creation jobs: smh: ttlSecondsAfterFinished: 3600 diff --git a/charts/wandb-base/templates/role.yaml b/charts/wandb-base/templates/role.yaml index 69d5e906..28be34c6 100644 --- a/charts/wandb-base/templates/role.yaml +++ b/charts/wandb-base/templates/role.yaml @@ -5,6 +5,10 @@ metadata: name: {{ include "wandb-base.fullname" .}} labels: {{- include "wandb-base.labels" . | nindent 4 }} + {{- with .Values.helmHookAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} rules: {{- with .Values.role.rules }} {{- toYaml . | nindent 4 }} diff --git a/charts/wandb-base/templates/rolebinding.yaml b/charts/wandb-base/templates/rolebinding.yaml index 747fdb44..6d7c6931 100644 --- a/charts/wandb-base/templates/rolebinding.yaml +++ b/charts/wandb-base/templates/rolebinding.yaml @@ -5,6 +5,10 @@ metadata: name: {{ include "wandb-base.fullname" . }} labels: {{- include "wandb-base.labels" . | nindent 4 }} + {{- with .Values.helmHookAnnotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} subjects: - kind: ServiceAccount name: {{ include "wandb-base.serviceAccountName" . }} diff --git a/charts/wandb-base/templates/serviceaccount.yaml b/charts/wandb-base/templates/serviceaccount.yaml index 24c8467e..cc747902 100644 --- a/charts/wandb-base/templates/serviceaccount.yaml +++ b/charts/wandb-base/templates/serviceaccount.yaml @@ -5,9 +5,15 @@ metadata: name: {{ include "wandb-base.serviceAccountName" . }} labels: {{- include "wandb-base.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} + {{- if or .Values.helmHookAnnotations .Values.serviceAccount.annotations }} annotations: - {{- toYaml . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.helmHookAnnotations }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} + automountServiceAccountToken: {{ .Values.serviceAccount.automount }} {{- end }} diff --git a/charts/wandb-base/values.yaml b/charts/wandb-base/values.yaml index 4adf0491..c7c7dfe6 100644 --- a/charts/wandb-base/values.yaml +++ b/charts/wandb-base/values.yaml @@ -18,6 +18,8 @@ imagePullSecrets: [] nameOverride: "" fullnameOverride: "" +helmHookAnnotations: {} + env: {} envFrom: {}