feat(admission controller): Add new webhook settings
What does this PR do?
Add support for the new Cluster Agent Admission settings.
Motivation
Needed to support new Cluster Agent settings.
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
- Cluster Agent: v7.59.0
Describe your test plan
Using the following settings:
features:
admissionController:
enabled: true
validation:
enabled: false
mutation:
enabled: false
Make sure that the output of those commands is as follows:
➜ kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io -A
No resources found
➜ kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io -A
No resources found
Modify the setting with:
features:
admissionController:
enabled: true
validation:
enabled: true
mutation:
enabled: true
Make sure that the output changes to:
➜ kubectl get validatingwebhookconfigurations.admissionregistration.k8s.io -A
NAME WEBHOOKS AGE
datadog-webhook 0 45s
➜ kubectl get mutatingwebhookconfigurations.admissionregistration.k8s.io -A
NAME WEBHOOKS AGE
datadog-webhook 3 47s
Checklist
- [x] PR has at least one valid label:
bug,enhancement,refactoring,documentation,tooling, and/ordependencies - [x] PR has a milestone or the
qa/skip-qalabel
Codecov Report
Attention: Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.
Project coverage is 48.66%. Comparing base (
49004a6) to head (4ec7879).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| api/datadoghq/v2alpha1/datadogagent_default.go | 80.00% | 1 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1461 +/- ##
==========================================
+ Coverage 48.56% 48.66% +0.10%
==========================================
Files 226 226
Lines 20329 20363 +34
==========================================
+ Hits 9872 9909 +37
+ Misses 9939 9937 -2
+ Partials 518 517 -1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 48.66% <95.23%> (+0.10%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| api/datadoghq/v2alpha1/datadogagent_types.go | 100.00% <ø> (ø) |
|
| api/datadoghq/v2alpha1/test/builder.go | 91.80% <100.00%> (+0.20%) |
:arrow_up: |
| ...atadogagent/feature/admissioncontroller/feature.go | 68.09% <100.00%> (+1.86%) |
:arrow_up: |
| internal/controller/datadogagent/feature/types.go | 26.92% <ø> (ø) |
|
| api/datadoghq/v2alpha1/datadogagent_default.go | 90.80% <80.00%> (+0.89%) |
:arrow_up: |
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 49004a6...4ec7879. Read the comment docs.