Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[profile][CECO-795] Add dap status #1155

Merged
merged 3 commits into from
May 30, 2024
Merged

[profile][CECO-795] Add dap status #1155

merged 3 commits into from
May 30, 2024

Conversation

khewonc
Copy link
Contributor

@khewonc khewonc commented Apr 29, 2024

What does this PR do?

Adds basic status to DAP.

kubectl get

NAME          VALID   APPLIED   AGE
dap-test      True    True      35m
invalid-dap   True    Unknown   34m

kubectl describe

Status:
  Applied:  True
  Conditions:
    Last Transition Time:  2024-04-29T15:06:11Z
    Message:               Profile applied
    Reason:                Applied
    Status:                True
    Type:                  Applied
    Last Transition Time:  2024-04-29T15:06:11Z
    Message:               Valid manifest
    Reason:                Valid
    Status:                True
    Type:                  Valid
  Current Hash:            4aaeaeee1b2fd2079c27b808a291f504
  Last Update:             2024-04-29T15:06:11Z
  Valid:                   True

Motivation

What inspired you to submit this pull request?

Additional Notes

  • Valid and Applied are added as both conditions and separate fields in the dap status. Conditions can give more detail on a potential error and separate fields allow them to be listed in the kubectl get output

Minimum Agent Versions

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

  • Agent: n/a
  • Cluster Agent: n/a

Describe your test plan

  • DAP should work as normal
  • DAP status (kubectl get dap, kubectl describe dap) should show a status
  • DAP status should update when DAP is updated. Example: add a valid dap -> invalidate dap spec by removing a required section like profileNodeAffinity -> go back to valid dap

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

@khewonc khewonc added the enhancement New feature or request label Apr 29, 2024
@khewonc khewonc added this to the v1.7.0 milestone Apr 29, 2024
@khewonc khewonc requested review from a team as code owners April 29, 2024 20:24
controllers/datadogagent/controller_reconcile_v2.go Outdated Show resolved Hide resolved
controllers/datadogagent/controller_reconcile_v2.go Outdated Show resolved Hide resolved
controllers/datadogagent/controller_reconcile_v2.go Outdated Show resolved Hide resolved
controllers/datadogagent/controller_reconcile_v2.go Outdated Show resolved Hide resolved
controllers/datadogagent/controller_reconcile_v2.go Outdated Show resolved Hide resolved
pkg/agentprofile/agent_profile.go Show resolved Hide resolved
pkg/agentprofile/agent_profile.go Outdated Show resolved Hide resolved
pkg/agentprofile/agent_profile.go Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 29, 2024

Codecov Report

Attention: Patch coverage is 67.91045% with 43 lines in your changes are missing coverage. Please review.

Project coverage is 59.48%. Comparing base (54c1ee3) to head (79a1a8a).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1155      +/-   ##
==========================================
+ Coverage   59.23%   59.48%   +0.25%     
==========================================
  Files         176      177       +1     
  Lines       22040    22275     +235     
==========================================
+ Hits        13055    13251     +196     
- Misses       8184     8219      +35     
- Partials      801      805       +4     
Flag Coverage Δ
unittests 59.48% <67.91%> (+0.25%) ⬆️

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

Files Coverage Δ
...is/datadoghq/v1alpha1/datadogagentprofile_types.go 100.00% <ø> (ø)
apis/datadoghq/v2alpha1/datadogagent_types.go 100.00% <ø> (ø)
pkg/agentprofile/status.go 75.60% <75.60%> (ø)
pkg/agentprofile/agent_profile.go 61.06% <71.15%> (-12.74%) ⬇️
...ontrollers/datadogagent/controller_reconcile_v2.go 54.93% <56.09%> (+5.41%) ⬆️

... and 2 files with indirect coverage changes


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 54c1ee3...79a1a8a. Read the comment docs.

@khewonc khewonc merged commit 0f02f37 into main May 30, 2024
19 checks passed
@khewonc khewonc deleted the khewonc/dap-status branch May 30, 2024 14:25
khewonc added a commit that referenced this pull request May 30, 2024
* Add dap status

* Review suggestions

* Fix tests
khewonc added a commit that referenced this pull request May 30, 2024
* Add dap status

* Review suggestions

* Fix tests
mftoure pushed a commit that referenced this pull request Oct 3, 2024
* Add dap status

* Review suggestions

* Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants