diff --git a/library/common-test/tests/externalInterfaces/externalInterfaces_test.yaml b/library/common-test/tests/externalInterfaces/externalInterfaces_test.yaml index 40702233b4..ce78f71f3d 100644 --- a/library/common-test/tests/externalInterfaces/externalInterfaces_test.yaml +++ b/library/common-test/tests/externalInterfaces/externalInterfaces_test.yaml @@ -165,12 +165,12 @@ tests: count: 4 - isKind: of: Deployment - - isSubset: + - isNull: path: metadata.annotations + - isSubset: + path: spec.template.metadata.annotations content: k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0 - - isNull: - path: metadata.annotations.rollme - matchRegex: path: spec.template.metadata.annotations.rollme pattern: "^[a-zA-Z0-9]{5}$" @@ -254,12 +254,12 @@ tests: count: 5 - isKind: of: Deployment - - isSubset: + - isNull: path: metadata.annotations + - isSubset: + path: spec.template.metadata.annotations content: k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0, ix-RELEASE-NAME-1 - - isNull: - path: metadata.annotations.rollme - matchRegex: path: spec.template.metadata.annotations.rollme pattern: "^[a-zA-Z0-9]{5}$" diff --git a/library/common/1.0.0/templates/class/_cronjob.tpl b/library/common/1.0.0/templates/class/_cronjob.tpl index 39c18038e2..8541870a2e 100644 --- a/library/common/1.0.0/templates/class/_cronjob.tpl +++ b/library/common/1.0.0/templates/class/_cronjob.tpl @@ -25,7 +25,7 @@ metadata: labels: {{- . | nindent 4 }} {{- end }} - {{- $annotations := (mustMerge ($job.annotations | default dict) (include "ix.v1.common.annotations" $root | fromYaml) (include "ix.v1.common.podAnnotations" $root | fromYaml) (include "ix.v1.common.annotations.workload.spec" $root | fromYaml)) -}} + {{- $annotations := (mustMerge ($job.annotations | default dict) (include "ix.v1.common.annotations" $root | fromYaml) (include "ix.v1.common.podAnnotations" $root | fromYaml)) -}} {{- with (include "ix.v1.common.util.annotations.render" (dict "root" $root "annotations" $annotations) | trim) }} annotations: {{- . | nindent 4 }} diff --git a/library/common/1.0.0/templates/class/_job.tpl b/library/common/1.0.0/templates/class/_job.tpl index e36e1c32a3..80bf5b40ca 100644 --- a/library/common/1.0.0/templates/class/_job.tpl +++ b/library/common/1.0.0/templates/class/_job.tpl @@ -12,7 +12,7 @@ metadata: labels: {{- . | nindent 4 }} {{- end }} - {{- $annotations := (mustMerge ($job.annotations | default dict) (include "ix.v1.common.annotations" $root | fromYaml) (include "ix.v1.common.podAnnotations" $root | fromYaml) (include "ix.v1.common.annotations.workload.spec" $root | fromYaml)) -}} + {{- $annotations := (mustMerge ($job.annotations | default dict) (include "ix.v1.common.annotations" $root | fromYaml) (include "ix.v1.common.podAnnotations" $root | fromYaml)) -}} {{- with (include "ix.v1.common.util.annotations.render" (dict "root" $root "annotations" $annotations) | trim) }} annotations: {{- . | nindent 4 }} diff --git a/library/common/1.0.0/templates/lib/general/_annotations.tpl b/library/common/1.0.0/templates/lib/general/_annotations.tpl index 2b90a09025..1a3c08880d 100644 --- a/library/common/1.0.0/templates/lib/general/_annotations.tpl +++ b/library/common/1.0.0/templates/lib/general/_annotations.tpl @@ -8,24 +8,17 @@ Rendered under ".metadata.annotations" {{- include "ix.v1.common.util.annotations.render" (dict "root" . "annotations" .Values.global.annotations) -}} {{- end -}} -{{/* -These annotations will be applied to all "workload" "spec" objects -Rendered under ".spec.template.metadata.annotations" -*/}} -{{- define "ix.v1.common.annotations.workload.spec" -}} - {{- if .Values.ixExternalInterfacesConfiguration -}} - {{- if .Values.ixExternalInterfacesConfigurationNames }} -k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }} - {{- else -}} - {{- fail "There are externalInterfaces defined, but key is empty." -}} - {{- end }} - {{- end -}} -{{- end -}} - {{/* These annotations will be applied to all "workload" objects Rendered under ".metadata.annotations" */}} {{- define "ix.v1.common.annotations.workload" -}} rollme: {{ randAlphaNum 5 | quote }} +{{- if .Values.ixExternalInterfacesConfiguration }} + {{- if .Values.ixExternalInterfacesConfigurationNames }} +k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }} + {{- else -}} + {{- fail "There are externalInterfaces defined, but key is empty." -}} + {{- end }} +{{- end -}} {{- end -}} diff --git a/library/common/1.0.0/templates/lib/general/_labels.tpl b/library/common/1.0.0/templates/lib/general/_labels.tpl index 5f81bc69fa..390ef3bd9f 100644 --- a/library/common/1.0.0/templates/lib/general/_labels.tpl +++ b/library/common/1.0.0/templates/lib/general/_labels.tpl @@ -15,4 +15,6 @@ helm-revision: {{ .Release.Revision | quote }} {{- define "ix.v1.common.labels.selectorLabels" -}} app.kubernetes.io/name: {{ include "ix.v1.common.names.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} +app: {{ include "ix.v1.common.names.name" . }} +release: {{ .Release.Name }} {{- end -}} diff --git a/library/common/1.0.0/templates/pods/_daemonset.tpl b/library/common/1.0.0/templates/pods/_daemonset.tpl index 1f6b1c1e67..079016d63b 100644 --- a/library/common/1.0.0/templates/pods/_daemonset.tpl +++ b/library/common/1.0.0/templates/pods/_daemonset.tpl @@ -13,7 +13,7 @@ metadata: labels: {{- . | nindent 4 }} {{- end }} - {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml) (include "ix.v1.common.annotations.workload.spec" $ | fromYaml)) -}} + {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml)) -}} {{- with (include "ix.v1.common.util.annotations.render" (dict "root" $ "annotations" $annotations) | trim) }} annotations: {{- . | nindent 4 }} diff --git a/library/common/1.0.0/templates/pods/_deployment.tpl b/library/common/1.0.0/templates/pods/_deployment.tpl index d03e199d40..812ca4042c 100644 --- a/library/common/1.0.0/templates/pods/_deployment.tpl +++ b/library/common/1.0.0/templates/pods/_deployment.tpl @@ -13,7 +13,7 @@ metadata: labels: {{- . | nindent 4 }} {{- end }} - {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml) (include "ix.v1.common.annotations.workload.spec" $ | fromYaml)) -}} + {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml)) -}} {{- with (include "ix.v1.common.util.annotations.render" (dict "root" $ "annotations" $annotations) | trim) }} annotations: {{- . | nindent 4 }} diff --git a/library/common/1.0.0/templates/pods/_statefulset.tpl b/library/common/1.0.0/templates/pods/_statefulset.tpl index 30fdbf546a..ca4bc6f0a3 100644 --- a/library/common/1.0.0/templates/pods/_statefulset.tpl +++ b/library/common/1.0.0/templates/pods/_statefulset.tpl @@ -13,7 +13,7 @@ metadata: labels: {{- . | nindent 4 }} {{- end }} - {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml) (include "ix.v1.common.annotations.workload.spec" $ | fromYaml)) -}} + {{- $annotations := (mustMerge (default dict .Values.controller.annotations) (include "ix.v1.common.annotations" $ | fromYaml)) -}} {{- with (include "ix.v1.common.util.annotations.render" (dict "root" $ "annotations" $annotations) | trim) }} annotations: {{- . | nindent 4 }}