Skip to content

Commit 175ddd8

Browse files
committed
fix: correct critical bugs in DaemonSet templates
This commit fixes 2 critical bugs discovered during functional E2E testing: **Critical Bug #1: DaemonSet Selector Label Mismatch** - **Issue**: DaemonSet selector used static labels (`app`, `release`) while pod template used common-library labels (`app.kubernetes.io/name`, `app.kubernetes.io/instance`) - **Impact**: Kubernetes rejects DaemonSet deployment with error: `selector does not match template labels` - **Root Cause**: When migrating pod labels to common-library helpers, DaemonSet selector wasn't updated - **Fix**: Updated both `daemonset.yaml` and `daemonset-windows.yaml` to use `newrelic.common.labels.selectorLabels` helper **Critical Bug #2: VerboseLog Boolean Evaluation** - **Issue**: Template compared boolean \$verboseLog variable as string \"true\" instead of boolean - **Impact**: Setting `global.verboseLog=true` didn't set `LOG_LEVEL=debug` (silent configuration failure) - **Root Cause**: Common-library `verboseLog` helper returns boolean value, but template used string comparison - **Fix**: Changed condition from `eq \$verboseLog \"true\"` to `if \$verboseLog` in both Linux and Windows DaemonSets Both bugs were found by functional E2E tests (helm-unittest doesn't validate Kubernetes API rules or boolean evaluation edge cases).
1 parent aca0d06 commit 175ddd8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

charts/newrelic-logging/templates/daemonset-windows.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ spec:
1717
type: {{ $.Values.updateStrategy }}
1818
selector:
1919
matchLabels:
20-
app: {{ template "newrelic-logging.name" $ }}
21-
release: {{ $.Release.Name }}
20+
{{- include "newrelic.common.labels.selectorLabels" $ | nindent 6 }}
2221
kubernetes.io/os: windows
2322
template:
2423
metadata:
@@ -86,7 +85,7 @@ spec:
8685
{{- if $logLevel }}
8786
- name: LOG_LEVEL
8887
value: {{ $logLevel | quote }}
89-
{{- else if eq $verboseLog "true" }}
88+
{{- else if $verboseLog }}
9089
- name: LOG_LEVEL
9190
value: "debug"
9291
{{- else }}

charts/newrelic-logging/templates/daemonset.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ spec:
1515
type: {{ .Values.updateStrategy }}
1616
selector:
1717
matchLabels:
18-
app: {{ template "newrelic-logging.name" . }}
19-
release: {{.Release.Name }}
18+
{{- include "newrelic.common.labels.selectorLabels" . | nindent 6 }}
2019
template:
2120
metadata:
2221
annotations:
@@ -97,7 +96,7 @@ spec:
9796
{{- if $logLevel }}
9897
- name: LOG_LEVEL
9998
value: {{ $logLevel | quote }}
100-
{{- else if eq $verboseLog "true" }}
99+
{{- else if $verboseLog }}
101100
- name: LOG_LEVEL
102101
value: "debug"
103102
{{- else }}

0 commit comments

Comments
 (0)