Skip to content

Update reason in status for invalid daps#3261

Merged
khewonc merged 1 commit into
mainfrom
khewonc/dap-invalid-status
Jul 15, 2026
Merged

Update reason in status for invalid daps#3261
khewonc merged 1 commit into
mainfrom
khewonc/dap-invalid-status

Conversation

@khewonc

@khewonc khewonc commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Add a reason to the status since the status update is invalid without it:

{"level":"ERROR","ts":"2026-07-15T13:55:32.274Z","logger":"controllers.DatadogAgent","msg":"unable to update profile status","datadogagentprofile":"datadogagentprofile-sample","datadogagentprofile_namespace":"default","error":"DatadogAgentProfile.datadoghq.com \"datadogagentprofile-sample\" is invalid: status.conditions[1].reason: Invalid value: \"\": conditions[1].reason in body should be at least 1 chars long","stacktrace":"github.com/DataDog/datadog-operator/internal/controller/datadogagent.(*Reconciler).reconcileProfiles\n\t/workspace/internal/controller/datadogagent/profile.go:97\ngithub.com/DataDog/datadog-operator/internal/controller/datadogagent.(*Reconciler).reconcileInstanceV3\n\t/workspace/internal/controller/datadogagent/controller_reconcile_v2.go:118\ngithub.com/DataDog/datadog-operator/internal/controller/datadogagent.(*

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

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

Create an invalid DAP

  config:
    override:
      nodeAgent:
        nodeSelector:
          disktype: ssd

The operator should reject it: {"level":"ERROR","ts":"2026-07-15T14:17:10.961Z","logger":"controllers.DatadogAgent","msg":"unable to reconcile profile","datadogagentprofile":"invalid-dap","datadogagentprofile_namespace":"default","error":"profile spec is invalid: component node selector override is not supported","stacktrace":...}

The dap status should update:

$ kubectl get dap
NAME          VALID   APPLIED   AGE
invalid-dap   False   Unknown   24m

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)

@khewonc khewonc added this to the v1.29.0 milestone Jul 15, 2026
@khewonc
khewonc requested a review from a team July 15, 2026 14:21
@khewonc khewonc added the bug Something isn't working label Jul 15, 2026
@datadog-prod-us1-4

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 46.66% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c2dae80 | Docs | Datadog PR Page | Give us feedback!

@khewonc
khewonc merged commit 4c971b4 into main Jul 15, 2026
37 of 45 checks passed
@khewonc
khewonc deleted the khewonc/dap-invalid-status branch July 15, 2026 14:43
khewonc added a commit that referenced this pull request Jul 15, 2026
(cherry picked from commit 4c971b4)

Co-authored-by: khewonc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants