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

feat(admission controller): add ValidatingWebhookConfigurations RBAC #1377

Merged

Conversation

wdhif
Copy link
Member

@wdhif wdhif commented Aug 28, 2024

What does this PR do?

Adds the necessary RBACs for the Cluster Agent to modify the ValidatingWebhookConfigurations.

Motivation

This is needed to support the new ValidatingAdmissionWebhook controller in the Agent's Admission Controller.

Minimum Agent Versions

Agent: v7.58.0
Cluster Agent: v7.58.0

Describe your test plan

Build the Operator and validate that the new ValidatingAdmissionWebhook is created with the new Agent.

➜ k describe validatingwebhookconfigurations.admissionregistration.k8s.io datadog-webhook
Name:         datadog-webhook
Namespace:
Labels:       <none>
Annotations:  <none>
API Version:  admissionregistration.k8s.io/v1
Kind:         ValidatingWebhookConfiguration
Metadata:
  Creation Timestamp:  2024-08-28T09:07:22Z
  Generation:          1
  Resource Version:    832
  UID:                 efd5e35d-8257-46ba-bdc7-b35268bf7c15
Events:                <none>

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

@wdhif wdhif added enhancement New feature or request qa/skip-qa labels Aug 28, 2024
@wdhif wdhif requested review from a team as code owners August 28, 2024 09:09
@wdhif wdhif added this to the v1.9.0 milestone Aug 28, 2024
@wdhif wdhif force-pushed the CONTP-378/wassim.dhif/implement-validating-admission-webhook branch from d2d483e to efd0757 Compare August 28, 2024 12:00
@wdhif wdhif requested a review from davidor August 28, 2024 12:01
@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 23.52941% with 13 lines in your changes missing coverage. Please review.

Project coverage is 47.11%. Comparing base (ddaac56) to head (6cab9e8).

Files with missing lines Patch % Lines
pkg/equality/equality.go 0.00% 9 Missing ⚠️
pkg/kubernetes/objects.go 0.00% 2 Missing ⚠️
pkg/kubernetes/objectslist.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1377      +/-   ##
==========================================
- Coverage   47.14%   47.11%   -0.03%     
==========================================
  Files         217      217              
  Lines       18768    18782      +14     
==========================================
+ Hits         8849     8850       +1     
- Misses       9457     9470      +13     
  Partials      462      462              
Flag Coverage Δ
unittests 47.11% <23.52%> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
...s/datadogagent/feature/admissioncontroller/rbac.go 89.65% <100.00%> (ø)
controllers/datadogagent_controller.go 70.00% <ø> (ø)
pkg/kubernetes/const.go 87.50% <100.00%> (+0.54%) ⬆️
pkg/kubernetes/objects.go 0.00% <0.00%> (ø)
pkg/kubernetes/objectslist.go 0.00% <0.00%> (ø)
pkg/equality/equality.go 11.62% <0.00%> (-0.65%) ⬇️

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 ddaac56...6cab9e8. Read the comment docs.

@wdhif wdhif force-pushed the CONTP-378/wassim.dhif/implement-validating-admission-webhook branch 4 times, most recently from 733faf7 to 818f086 Compare August 29, 2024 07:48
@wdhif wdhif force-pushed the CONTP-378/wassim.dhif/implement-validating-admission-webhook branch from 818f086 to a697b5b Compare August 29, 2024 08:02
@khewonc khewonc removed the qa/skip-qa label Sep 3, 2024
@levan-m levan-m merged commit a15b5bb into main Sep 3, 2024
21 checks passed
@levan-m levan-m deleted the CONTP-378/wassim.dhif/implement-validating-admission-webhook branch September 3, 2024 17:50
mftoure pushed a commit that referenced this pull request Oct 3, 2024
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.

5 participants