From 65bb4afb1aa1b0d702d33f5956d63f64800e786a Mon Sep 17 00:00:00 2001 From: Roberto Santalla Date: Fri, 13 May 2022 14:23:10 +0200 Subject: [PATCH] chart: add -scraper suffix to pod names --- .../templates/controlplane/_naming.tpl | 4 ++-- .../templates/ksm/_naming.tpl | 4 ++-- .../templates/kubelet/_naming.tpl | 4 ++-- .../newrelic-infrastructure/tests/podName_test.yaml | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/newrelic-infrastructure/templates/controlplane/_naming.tpl b/charts/newrelic-infrastructure/templates/controlplane/_naming.tpl index 7e651426b0..a9e77dd461 100644 --- a/charts/newrelic-infrastructure/templates/controlplane/_naming.tpl +++ b/charts/newrelic-infrastructure/templates/controlplane/_naming.tpl @@ -1,8 +1,8 @@ {{- /* Naming helpers*/ -}} {{- define "nriKubernetes.controlplane.fullname" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane-scraper") -}} {{- end -}} {{- define "nriKubernetes.controlplane.fullname.agent" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-controlplane") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "controlplane-agent") -}} {{- end -}} diff --git a/charts/newrelic-infrastructure/templates/ksm/_naming.tpl b/charts/newrelic-infrastructure/templates/ksm/_naming.tpl index d8c283c430..1ce9f05dc2 100644 --- a/charts/newrelic-infrastructure/templates/ksm/_naming.tpl +++ b/charts/newrelic-infrastructure/templates/ksm/_naming.tpl @@ -1,8 +1,8 @@ {{- /* Naming helpers*/ -}} {{- define "nriKubernetes.ksm.fullname" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm-scraper") -}} {{- end -}} {{- define "nriKubernetes.ksm.fullname.agent" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-ksm") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "ksm-agent") -}} {{- end -}} diff --git a/charts/newrelic-infrastructure/templates/kubelet/_naming.tpl b/charts/newrelic-infrastructure/templates/kubelet/_naming.tpl index 71c142156d..1159a4ea32 100644 --- a/charts/newrelic-infrastructure/templates/kubelet/_naming.tpl +++ b/charts/newrelic-infrastructure/templates/kubelet/_naming.tpl @@ -1,10 +1,10 @@ {{- /* Naming helpers*/ -}} {{- define "nriKubernetes.kubelet.fullname" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet-scraper") -}} {{- end -}} {{- define "nriKubernetes.kubelet.fullname.agent" -}} -{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "agent-kubelet") -}} +{{- include "newrelic.common.naming.truncateToDNSWithSuffix" (dict "name" (include "nriKubernetes.naming.fullname" .) "suffix" "kubelet-agent") -}} {{- end -}} {{- define "nriKubernetes.kubelet.fullname.integrations" -}} diff --git a/charts/newrelic-infrastructure/tests/podName_test.yaml b/charts/newrelic-infrastructure/tests/podName_test.yaml index 81b36c4af8..c9c1c54023 100644 --- a/charts/newrelic-infrastructure/tests/podName_test.yaml +++ b/charts/newrelic-infrastructure/tests/podName_test.yaml @@ -20,15 +20,15 @@ tests: asserts: - equal: path: metadata.name - value: RELEASE-NAME-nrk8s-ksm + value: RELEASE-NAME-nrk8s-ksm-scraper template: templates/ksm/deployment.yaml - equal: path: metadata.name - value: RELEASE-NAME-nrk8s-controlplane + value: RELEASE-NAME-nrk8s-controlplane-scraper template: templates/controlplane/daemonset.yaml - equal: path: metadata.name - value: RELEASE-NAME-nrk8s-kubelet + value: RELEASE-NAME-nrk8s-kubelet-scraper template: templates/kubelet/daemonset.yaml - it: name is overridden as expected set: @@ -38,13 +38,13 @@ tests: asserts: - equal: path: metadata.name - value: fno-ksm + value: fno-ksm-scraper template: templates/ksm/deployment.yaml - equal: path: metadata.name - value: fno-controlplane + value: fno-controlplane-scraper template: templates/controlplane/daemonset.yaml - equal: path: metadata.name - value: fno-kubelet + value: fno-kubelet-scraper template: templates/kubelet/daemonset.yaml