Skip to content

Commit

Permalink
chart: add -scraper suffix to pod names
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed May 13, 2022
1 parent ee09a53 commit 65bb4af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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 -}}
4 changes: 2 additions & 2 deletions charts/newrelic-infrastructure/templates/ksm/_naming.tpl
Original file line number Diff line number Diff line change
@@ -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 -}}
4 changes: 2 additions & 2 deletions charts/newrelic-infrastructure/templates/kubelet/_naming.tpl
Original file line number Diff line number Diff line change
@@ -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" -}}
Expand Down
12 changes: 6 additions & 6 deletions charts/newrelic-infrastructure/tests/podName_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 65bb4af

Please sign in to comment.