From 75f3e3c944be9761e0bf08e2cf2aa88ecb34c349 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Sun, 29 Jan 2023 22:23:33 +0200 Subject: [PATCH] make clear on call template that need root context --- .github/ct-install-config/ct-install.yaml | 5 +---- .github/ct-install-config/ct-lint.yaml | 5 +---- .../templates/lib/metadata/_allAnnotations.tpl | 2 +- .../1.0.0/templates/lib/metadata/_allLabels.tpl | 2 +- .../1.0.0/templates/lib/metadata/_podLabels.tpl | 15 +++++++++++++++ .../common/1.0.0/templates/spawner/_configmap.tpl | 2 +- .../1.0.0/templates/spawner/_controller.tpl | 2 +- .../common/1.0.0/templates/spawner/_secret.tpl | 2 +- library/common/1.0.0/templates/values/_init.tpl | 2 +- library/common/1.0.0/values.yaml | 4 ++-- 10 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 library/common/1.0.0/templates/lib/metadata/_podLabels.tpl diff --git a/.github/ct-install-config/ct-install.yaml b/.github/ct-install-config/ct-install.yaml index f6081824c4..45121f564e 100644 --- a/.github/ct-install-config/ct-install.yaml +++ b/.github/ct-install-config/ct-install.yaml @@ -5,7 +5,4 @@ chart-yaml-schema: .github/ct-install-config/chart_schema.yaml chart-dirs: - library - charts -# TODO: Remove -excluded-charts: - - common/1.0.0 - - common-test +excluded-charts: [] diff --git a/.github/ct-install-config/ct-lint.yaml b/.github/ct-install-config/ct-lint.yaml index 9a74d15505..6dc691ffe1 100644 --- a/.github/ct-install-config/ct-lint.yaml +++ b/.github/ct-install-config/ct-lint.yaml @@ -4,7 +4,4 @@ helm-extra-args: --timeout 600s --debug chart-yaml-schema: .github/ct-install-config/chart_schema.yaml chart-dirs: - library -# TODO: Remove -excluded-charts: - - common/1.0.0 - - common-test +excluded-charts: [] diff --git a/library/common/1.0.0/templates/lib/metadata/_allAnnotations.tpl b/library/common/1.0.0/templates/lib/metadata/_allAnnotations.tpl index 408f7bb348..0a2d6ddfea 100644 --- a/library/common/1.0.0/templates/lib/metadata/_allAnnotations.tpl +++ b/library/common/1.0.0/templates/lib/metadata/_allAnnotations.tpl @@ -1,6 +1,6 @@ {{/* Annotations that are added to all objects */}} {{/* Call this template: -{{ include "ix.v1.common.lib.metadata.allAnnotations" . }} +{{ include "ix.v1.common.lib.metadata.allAnnotations" $ }} */}} {{- define "ix.v1.common.lib.metadata.allAnnotations" -}} {{/* Currently empty but can add later, if needed */}} diff --git a/library/common/1.0.0/templates/lib/metadata/_allLabels.tpl b/library/common/1.0.0/templates/lib/metadata/_allLabels.tpl index 4a71f26c93..838ae80835 100644 --- a/library/common/1.0.0/templates/lib/metadata/_allLabels.tpl +++ b/library/common/1.0.0/templates/lib/metadata/_allLabels.tpl @@ -1,6 +1,6 @@ {{/* Labels that are added to all objects */}} {{/* Call this template: -{{ include "ix.v1.common.lib.metadata.allLabels" . }} +{{ include "ix.v1.common.lib.metadata.allLabels" $ }} */}} {{- define "ix.v1.common.lib.metadata.allLabels" -}} helm.sh/chart: {{ include "ix.v1.common.lib.chart.names.chart" . }} diff --git a/library/common/1.0.0/templates/lib/metadata/_podLabels.tpl b/library/common/1.0.0/templates/lib/metadata/_podLabels.tpl new file mode 100644 index 0000000000..eb58759a73 --- /dev/null +++ b/library/common/1.0.0/templates/lib/metadata/_podLabels.tpl @@ -0,0 +1,15 @@ +{{/* Labels that are added to podSpec */}} +{{/* Call this template: +{{ include "ix.v1.common.lib.metadata.podLabels" $ }} +*/}} +{{- define "ix.v1.common.lib.metadata.podLabels" -}} +rollme: {{ randAlphaNum 5 | quote }} +{{- if and .Values.ixExternalInterfacesConfiguration -}} + {{- if .Values.ixExternalInterfacesConfigurationNames }} +k8s.v1.cni.cncf.io/networks: {{ join ", " .Values.ixExternalInterfacesConfigurationNames }} + {{- else -}} + {{- fail "Found external interfaces defined, but is empty." -}} + {{- end -}} +{{- end -}} + +{{- end -}} diff --git a/library/common/1.0.0/templates/spawner/_configmap.tpl b/library/common/1.0.0/templates/spawner/_configmap.tpl index 461f399ce7..aa1c7ca511 100644 --- a/library/common/1.0.0/templates/spawner/_configmap.tpl +++ b/library/common/1.0.0/templates/spawner/_configmap.tpl @@ -1,6 +1,6 @@ {{/* Configmap Spawwner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.configmaps" . -}} +{{ include "ix.v1.common.spawner.configmaps" $ -}} */}} {{- define "ix.v1.common.spawner.configmaps" -}} diff --git a/library/common/1.0.0/templates/spawner/_controller.tpl b/library/common/1.0.0/templates/spawner/_controller.tpl index ea46777a63..2e0e3cac2b 100644 --- a/library/common/1.0.0/templates/spawner/_controller.tpl +++ b/library/common/1.0.0/templates/spawner/_controller.tpl @@ -1,6 +1,6 @@ {{/* Configmap Spawwner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.configmaps" . -}} +{{ include "ix.v1.common.spawner.configmaps" $ -}} */}} {{- define "ix.v1.common.spawner.configmaps" -}} diff --git a/library/common/1.0.0/templates/spawner/_secret.tpl b/library/common/1.0.0/templates/spawner/_secret.tpl index b9f1ccdd59..384ae618ce 100644 --- a/library/common/1.0.0/templates/spawner/_secret.tpl +++ b/library/common/1.0.0/templates/spawner/_secret.tpl @@ -1,6 +1,6 @@ {{/* Secret Spawwner */}} {{/* Call this template: -{{ include "ix.v1.common.spawner.secrets" . -}} +{{ include "ix.v1.common.spawner.secrets" $ -}} */}} {{- define "ix.v1.common.spawner.secrets" -}} diff --git a/library/common/1.0.0/templates/values/_init.tpl b/library/common/1.0.0/templates/values/_init.tpl index 089119d021..69e207602f 100644 --- a/library/common/1.0.0/templates/values/_init.tpl +++ b/library/common/1.0.0/templates/values/_init.tpl @@ -1,7 +1,7 @@ {{/* Merge chart values and the common chart defaults */}} {{/* The ".common" is the name of the library */}} {{/* Call this template: -{{ include "ix.v1.common.values.init" }} +{{ include "ix.v1.common.values.init" $ }} */}} {{- define "ix.v1.common.values.init" -}} diff --git a/library/common/1.0.0/values.yaml b/library/common/1.0.0/values.yaml index 37a388e3b7..e566f9fa89 100644 --- a/library/common/1.0.0/values.yaml +++ b/library/common/1.0.0/values.yaml @@ -35,7 +35,7 @@ image: # -- Image pull policy pullPolicy: IfNotPresent -# -- ConfigMaps +# -- ConfigMaps (docs/configmaps.md) configmaps: {} # # -- ConfigMap name # conf-name: @@ -48,7 +48,7 @@ configmaps: {} # # -- ConfigMap data # data: {} -# -- Secrets +# -- Secrets (docs/secrets.md) secrets: {} # # -- Secret name # secret-name: