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 2d14fae
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 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
14 changes: 7 additions & 7 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
template: templates/ksm/deployment.yaml
value: fno-ksm-scraper
template: templates/ksm/deployment.yamlv
- 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 2d14fae

Please sign in to comment.