Fix CCR hostname mismatch causing ghost hosts in Remote Configuration#2665
Draft
piochelepiotr wants to merge 1 commit intoDataDog:mainfrom
Draft
Fix CCR hostname mismatch causing ghost hosts in Remote Configuration#2665piochelepiotr wants to merge 1 commit intoDataDog:mainfrom
piochelepiotr wants to merge 1 commit intoDataDog:mainfrom
Conversation
When the operator deploys CCRs, it sets DD_HOSTNAME to the raw node name via spec.nodeName. However, the node agent constructs its hostname by appending the cluster name. This mismatch causes the RC backend to create ghost hosts. Replace DD_HOSTNAME with an intermediate DD_CCR_NODE_NAME env var that holds the raw node name, then construct DD_HOSTNAME in applyClusterChecksRunnerResources() using k8s env var substitution to append the cluster name suffix when configured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2665 +/- ##
==========================================
+ Coverage 38.59% 38.85% +0.25%
==========================================
Files 307 307
Lines 26471 26478 +7
==========================================
+ Hits 10216 10287 +71
+ Misses 15494 15430 -64
Partials 761 761
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Summary
DD_HOSTNAMEin CCR default env vars with an intermediateDD_CCR_NODE_NAMEenv var that holds the raw node name from the downward API (spec.nodeName)applyClusterChecksRunnerResources()to constructDD_HOSTNAMEusing k8s env var substitution:$(DD_CCR_NODE_NAME)-<clusterName>when cluster name is configured, or$(DD_CCR_NODE_NAME)otherwiseNote: An alternative approach worth considering is to not set
DD_HOSTNAMEat all and instead let the CCR agent resolve its hostname through its normal resolution path (which already respectsDD_CLUSTER_NAME). This would avoid duplicating hostname construction logic in the operator. This PR takes the env var substitution approach as a starting point for discussion.Test plan
DD_CCR_NODE_NAMEis set fromspec.nodeNamein default env varsDD_HOSTNAMEis not directly in default env varsDD_HOSTNAMEincludes cluster name suffix when cluster name is configuredDD_HOSTNAMEfalls back to just node name when cluster name is not configured🤖 Generated with Claude Code