mirror of
https://github.com/truenas/charts.git
synced 2026-06-18 01:26:53 +08:00
fix annotation for cni
This commit is contained in:
@@ -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}$"
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 <ixExternalInterfaceConfigurationNames> 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 <ixExternalInterfaceConfigurationNames> is empty." -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -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 -}}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user