newrelic-logging: Add Comprehensive Global Value Inheritance Test Coverage and Fix Critical Bugs #2023
+912
−46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds comprehensive test coverage validating global value inheritance for the newrelic-logging chart, implements 6 missing critical global values, and fixes 2 critical bugs discovered during testing. The chart uses common-library version 1.3.3 for most global value implementations. This work addresses the most critical gaps identified in the nri-bundle refactor project: proxy support for corporate environments, scheduling constraints (priorityClassName, nodeSelector, tolerations), and verbose logging.
Changes
Fixed Pre-Existing Bugs
Critical Bug #1: DaemonSet Selector Label Mismatch
app,release) while pod template used common-library labels (app.kubernetes.io/name,app.kubernetes.io/instance)selector does not match template labelsdaemonset.yamlanddaemonset-windows.yamlto usenewrelic.common.labels.selectorLabelshelperCritical Bug #2: VerboseLog Inheritance Not Working
global.verboseLog=truedidn't setLOG_LEVEL=debugin Fluent Bit containers (silent configuration failure)values.yamlhadlogLevel: "info"as default, causing template'sif $logLevelcheck to always be true, preventingglobal.verboseLogevaluationfluentBit.logLeveldefault from"info"to""(empty string), allowing template to checkglobal.verboseLogwhen no explicit logLevel is setAdded Comprehensive Global Value Inheritance Tests
Created 47 new test cases in
tests/global-inheritance_test.yamlvalidating:global.verboseLog: truetoLOG_LEVEL=debug(4 tests: default/global/local/override)Implemented Missing Global Values
templates/daemonset.yaml & templates/daemonset-windows.yaml:
proxyenvironment variables (HTTP_PROXY/HTTPS_PROXY) with global/local precedencepriorityClassNamewithnewrelic.common.priorityClassNamehelpernodeSelectorwithnewrelic.common.nodeSelectorhelper (preserving Windows OS labels)tolerationswithnewrelic.common.tolerationshelperaffinitylogic withnewrelic.common.affinityhelper (preserving Fargate exclusion)hostNetworkwith proper nil-safe global inheritance logicverboseLog→ LOG_LEVEL mapping (verboseLog overrides local logLevel when set)newrelic.common.labelsfor resource labelsnewrelic.common.labels.podLabelsfor pod labelstemplates/_helpers.tpl:
newrelic-logging.clusterhelper precedence: now local > global (was global > local)values.yaml:
proxy: ""field with documentation for HTTP/HTTPS proxy configurationKey Technical Improvements
Proxy Support:
global.proxyor uses chart-specificproxyoverrideScheduling Constraints:
priorityClassName,nodeSelector,tolerations,affinitynow use common-library helpersAffinity Enhancement:
Cluster Helper Fix:
Label Inheritance:
global.labelsandglobal.podLabelsinheritanceTest Results
Breakdown:
Global Values Coverage
Testing Approach
This chart validates ALL applicable global values through comprehensive helm-unittest tests, ensuring each value propagates correctly and respects override precedence. While common-library helpers handle the implementation, independent validation is industry-standard for infrastructure-as-code: it provides confidence that configuration changes work as expected without relying on upstream library assumptions.
Legend
Yes- Chart includes explicit helm-unittest test coverage with dedicated test casesNo- Value not applicable to this chart typeComplete Global Values Status
Files Modified
Templates
templates/daemonset.yaml- Fixed selector labels, verboseLog boolean evaluation, added proxy env vars, scheduling helpers, hostNetwork, labelstemplates/daemonset-windows.yaml- Same changes as Linux DaemonSet (selector labels, verboseLog, proxy, scheduling, labels)templates/_helpers.tpl- Fixed cluster helper precedence (local > global)Values
values.yaml- Added proxy field with documentation, fixed logLevel default (empty string enables global.verboseLog inheritance)Tests
tests/global-inheritance_test.yaml- Added 47 comprehensive helm-unittest test cases (new file)No Breaking Changes
All changes maintain backward compatibility:
Build Status
Changelog Entry