pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/DataDog/datadog-operator/pull/2665

bal-94620c216484da1f.css" /> Fix CCR hostname mismatch causing ghost hosts in Remote Configuration by piochelepiotr · Pull Request #2665 · DataDog/datadog-operator · GitHub
Skip to content

Fix CCR hostname mismatch causing ghost hosts in Remote Configuration#2665

Draft
piochelepiotr wants to merge 1 commit intoDataDog:mainfrom
piochelepiotr:fix/ccr-hostname-cluster-name-suffix
Draft

Fix CCR hostname mismatch causing ghost hosts in Remote Configuration#2665
piochelepiotr wants to merge 1 commit intoDataDog:mainfrom
piochelepiotr:fix/ccr-hostname-cluster-name-suffix

Conversation

@piochelepiotr
Copy link

Summary

  • Replace DD_HOSTNAME in CCR default env vars with an intermediate DD_CCR_NODE_NAME env var that holds the raw node name from the downward API (spec.nodeName)
  • Implement applyClusterChecksRunnerResources() to construct DD_HOSTNAME using k8s env var substitution: $(DD_CCR_NODE_NAME)-<clusterName> when cluster name is configured, or $(DD_CCR_NODE_NAME) otherwise
  • This prevents the RC backend from creating ghost hosts due to hostname format mismatch between CCR and node agent

Note: An alternative approach worth considering is to not set DD_HOSTNAME at all and instead let the CCR agent resolve its hostname through its normal resolution path (which already respects DD_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

  • Unit test: DD_CCR_NODE_NAME is set from spec.nodeName in default env vars
  • Unit test: DD_HOSTNAME is not directly in default env vars
  • Unit test: DD_HOSTNAME includes cluster name suffix when cluster name is configured
  • Unit test: DD_HOSTNAME falls back to just node name when cluster name is not configured
  • Unit test: nil global config is handled gracefully
  • Verify generated CCR deployment has correct env var structure

🤖 Generated with Claude Code

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-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.85%. Comparing base (6489f08) to head (ec9a4b7).

Additional details and impacted files

Impacted file tree graph

@@            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              
Flag Coverage Δ
unittests 38.85% <100.00%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...adogagent/component/clusterchecksrunner/default.go 43.68% <100.00%> (+33.15%) ⬆️
...troller/datadogagent/global/clusterchecksrunner.go 100.00% <100.00%> (+100.00%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6489f08...ec9a4b7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy