Skip to content

[CONTP-1340] Delete previous OTEL Gateway deployment to properly support name override#2651

Merged
tbavelier merged 5 commits intomainfrom
tbavelier/remove-old-otelgateway
Feb 26, 2026
Merged

[CONTP-1340] Delete previous OTEL Gateway deployment to properly support name override#2651
tbavelier merged 5 commits intomainfrom
tbavelier/remove-old-otelgateway

Conversation

@tbavelier
Copy link
Member

@tbavelier tbavelier commented Feb 25, 2026

What does this PR do?

Like DCA/CCR, adds a cleanupOldOtelAgentGatewayDeployments to remove stale OTEL Gateway deployments, e.g. a user overrides the name, it should remove the default one

Motivation

Seamless experience for gateway the same as for DCA/CCR, name override should be properly supported

Additional Notes

It's based on #2635, so commit to review is 1d9fe7b

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

  1. Deploy a DDA with spec.features.otelAgentGateway.enabled=true
  2. You should see a dda-name-otel-agent-gateway deploy
  3. Add spec.override.otelAgentGateway.name=foo
  4. You should see a foo that is the otel agent gateway AND the dda-name-otel-agent-gateway deploy should not be present anymore

Also follow these steps to QA #2635 (commits on which the branch is based):

  1. Deploy a basic DDA
  2. Disable the clusterAgent component with an override spec.override.clusterAgent.disabled=true
    1. Verify the deployment is deleted
  3. Remove the disable override and add a name spec.override.clusterAgent.name=foo
    1. A foo- deployment should be created
  4. Add again the disable override and verify the foo deployment is cleaned up

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@tbavelier tbavelier added this to the v1.25.0 milestone Feb 25, 2026
@tbavelier tbavelier requested a review from a team February 25, 2026 09:05
@tbavelier tbavelier requested a review from a team as a code owner February 25, 2026 09:05
@tbavelier tbavelier added the bug Something isn't working label Feb 25, 2026
@tbavelier tbavelier merged commit e60a172 into main Feb 26, 2026
43 checks passed
@tbavelier tbavelier deleted the tbavelier/remove-old-otelgateway branch February 26, 2026 07:02
tbavelier added a commit that referenced this pull request Feb 27, 2026
Profile DDAIs only manage the Node Agent DaemonSet and should never
reconcile cluster-level components (DCA, CCR, OTel Gateway).

Previously this was harmless because the Cleanup function generated
deployment names from the profile DDAI name (e.g.
"profile-name-cluster-agent"), which never matched existing deployments.
PR #2651 added override.Deployment() in Cleanup to resolve the correct
deployment name via name overrides. Since profile DDAIs inherit the
parent DDA's name overrides (via SSA merge) alongside disabled=true,
Cleanup now resolves the real deployment name and deletes it, causing a
delete/recreate loop with the main DDAI.

Guard ReconcileComponents with isDDAILabeledWithProfile, consistent with
the existing guards for dependency management and cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gh-worker-dd-mergequeue-cf854d bot pushed a commit that referenced this pull request Feb 27, 2026
Skip component registry reconciliation for profile DDAIs

Profile DDAIs only manage the Node Agent DaemonSet and should never
reconcile cluster-level components (DCA, CCR, OTel Gateway).

Previously this was harmless because the Cleanup function generated
deployment names from the profile DDAI name (e.g.
"profile-name-cluster-agent"), which never matched existing deployments.
PR #2651 added override.Deployment() in Cleanup to resolve the correct
deployment name via name overrides. Since profile DDAIs inherit the
parent DDA's name overrides (via SSA merge) alongside disabled=true,
Cleanup now resolves the real deployment name and deletes it, causing a
delete/recreate loop with the main DDAI.

Guard ReconcileComponents with isDDAILabeledWithProfile, consistent with
the existing guards for dependency management and cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Merge branch 'main' into tbavelier/do-not-reconcile-components-from-ddai-profiles

Co-authored-by: levan-m <116471169+levan-m@users.noreply.github.com>
Co-authored-by: levan.machablishvili <levan.machablishvili@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants