Skip to content

Commit

Permalink
feat: added support for templated cluster name value
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanilho committed Feb 19, 2024
1 parent 66b6f48 commit d36004a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion charts/newrelic-logging/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart to deploy New Relic Kubernetes Logging as a DaemonSet, supporting both Linux and Windows nodes and containers
name: newrelic-logging
version: 1.20.2
version: 1.20.3
appVersion: 1.19.0
home: https://github.com/newrelic/kubernetes-logging
icon: https://newrelic.com/assets/newrelic/source/NewRelic-logo-square.svg
Expand Down
10 changes: 1 addition & 9 deletions charts/newrelic-logging/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ Return the licenseKey
Return the cluster name
*/}}
{{- define "newrelic-logging.cluster" -}}
{{- if .Values.global}}
{{- if .Values.global.cluster }}
{{- .Values.global.cluster -}}
{{- else -}}
{{- .Values.cluster | default "" -}}
{{- end -}}
{{- else -}}
{{- .Values.cluster | default "" -}}
{{- end -}}
{{ tpl (.Values.cluster | default .Values.global.cluster | default "") . }}
{{- end -}}

{{/*
Expand Down
2 changes: 1 addition & 1 deletion charts/nri-bundle/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
version: 3.8.1
- name: newrelic-logging
repository: https://newrelic.github.io/helm-charts
version: 1.20.2
version: 1.20.3
- name: newrelic-pixie
repository: https://newrelic.github.io/helm-charts
version: 2.1.2
Expand Down
2 changes: 1 addition & 1 deletion charts/nri-bundle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dependencies:
- name: newrelic-logging
repository: https://newrelic.github.io/helm-charts
condition: logging.enabled,newrelic-logging.enabled
version: 1.20.2
version: 1.20.3

- name: newrelic-pixie
repository: https://newrelic.github.io/helm-charts
Expand Down
2 changes: 1 addition & 1 deletion library/common-library/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: common-library
description: Provides helpers to provide consistency on all the charts

type: library
version: 1.1.1
version: 1.1.2

keywords:
- newrelic
Expand Down
4 changes: 2 additions & 2 deletions library/common-library/templates/_cluster.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Return the cluster
{{- $global := index .Values "global" | default dict -}}

{{- if .Values.cluster -}}
{{- .Values.cluster -}}
{{- tpl .Values.cluster . -}}
{{- else if $global.cluster -}}
{{- $global.cluster -}}
{{- tpl $global.cluster . -}}
{{- else -}}
{{ fail "There is not cluster name definition set neither in `.global.cluster' nor `.cluster' in your values.yaml. Cluster name is required." }}
{{- end -}}
Expand Down

0 comments on commit d36004a

Please sign in to comment.