nr-k8s-otel-collector: Add Comprehensive Global Value Inheritance Test Coverage#2026
Open
dpacheconr wants to merge 4 commits intonewrelic:masterfrom
Open
nr-k8s-otel-collector: Add Comprehensive Global Value Inheritance Test Coverage#2026dpacheconr wants to merge 4 commits intonewrelic:masterfrom
dpacheconr wants to merge 4 commits intonewrelic:masterfrom
Conversation
…itance test coverage - Add 74 new test cases in tests/global_inheritance_test.yaml - Validate all 21 applicable global values from nri-bundle specification - Test both Deployment and DaemonSet templates (dual workload architecture) - Validate 4-level precedence hierarchy (deployment > chart > global > defaults) - Test ConfigMap propagation for chart-specific values - Test Secret references for sensitive data - Test ServiceAccount annotations for IAM roles (IRSA/Workload Identity) - Bump chart version 0.9.7 → 0.9.8 Test Results: 185/185 passing (100% pass rate) - 74 new tests validating global value inheritance - 111 existing tests maintained (all passing) - All applicable global values covered
…rviceaccount tests - Remove redundant test case with 'global: null' that caused 'skipping globals' warning - Fix capabilities assignments in security_context tests (string → object structure) - Add explicit capabilities.drop configuration to match chart defaults - All 184 tests now passing with zero warnings Test Results: 184/184 passing (100% pass rate, no warnings)
… comprehensive tests - Add custom attributes to resource/newrelic processor in both ConfigMaps - Custom attributes propagate as OpenTelemetry resource attributes - Support both global.customAttributes and local customAttributes - Proper override precedence (local > global) - Add 5 comprehensive test cases validating: - Global custom attributes propagation to both workloads - Local/global merge behavior - Local override of global values - No attributes when not configured - All 189 tests passing (100% pass rate)
…edRAMP gov endpoint - Add fedramp endpoint selection in _endpoint.tpl (gov-otlp.nr-data.net) - Add 3 comprehensive tests for fedramp inheritance and precedence - Brings coverage to 21/21 applicable globals (100%) - All 192 tests passing
Contributor
|
Added to backlog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 with EXPLICIT validation of global value inheritance for all applicable values from the common-library, plus implementation of
global.customAttributessupport. Each applicable global value has dedicated test cases that directly validate propagation and override precedence. The chart now supports custom attributes injection into OpenTelemetry resource processors.Testing Philosophy
This chart validates ALL applicable global values through comprehensive helm-unittest tests. While common-library helpers handle the implementation, we test each global value with dedicated test cases showing both inheritance (global → chart) and precedence (local > global > default). This is infrastructure-as-code best practice providing confidence that configuration changes work as expected.
Changes
Added global.customAttributes Support
resource/newrelicprocessorglobal.customAttributesand localcustomAttributeswith proper override precedenceAdded Test Suite
tests/global_inheritance_test.yaml(79 original + 3 fedramp)Test Results
Test coverage includes:
Global Values Coverage
All 27 global values from the common-library assessed:
Legend:
Yes- Chart includes explicit helm-unittest test coverageNo- Value not applicable to this chart typeAll applicable global values have explicit test coverage with dedicated test cases and assertions.
Chart-Specific Behavior
Cluster Name Propagation
The cluster name is set in the ConfigMap (via resource attributes) rather than as an environment variable. This is validated through ConfigMap pattern matching in the test suite.
License Key Handling
The chart always uses a Secret reference (not plain values) for the license key. This is the secure pattern and is validated through Secret reference assertions.
Dual Workload Architecture
The chart deploys BOTH a Deployment (cluster-wide metrics) AND a DaemonSet (per-node metrics). All tests validate both templates to ensure consistent behavior across both workload types.
Custom Attributes as OTel Resource Attributes
Custom attributes from
global.customAttributesand localcustomAttributesare injected into the OpenTelemetry collector'sresource/newrelicprocessor as resource attributes. This allows standard global value patterns while maintaining OTel-native configuration.Files Modified
New Files
charts/nr-k8s-otel-collector/tests/global_inheritance_test.yaml- Added 79 test casesModified Files
charts/nr-k8s-otel-collector/Chart.yaml- Bumped version 0.9.7 → 0.9.8charts/nr-k8s-otel-collector/templates/deployment-configmap.yaml- Added custom attributes supportcharts/nr-k8s-otel-collector/templates/daemonset-configmap.yaml- Added custom attributes supportcharts/nr-k8s-otel-collector/templates/_endpoint.tpl- Added fedramp.enabled support for gov endpointNo Breaking Changes
Build Status
Changelog Entry