-
Notifications
You must be signed in to change notification settings - Fork 110
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
[CECO-662] Add registry options in admission controller #1181
[CECO-662] Add registry options in admission controller #1181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: bug, enhancement, refactoring, documentation, tooling, dependencies
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1181 +/- ##
==========================================
- Coverage 59.55% 58.93% -0.63%
==========================================
Files 174 175 +1
Lines 21559 21941 +382
==========================================
+ Hits 12839 12930 +91
- Misses 7941 8227 +286
- Partials 779 784 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor suggestion but otherwise looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests for setting the registry field in the feature_test.go
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test code file for AC has been added.
@@ -584,6 +584,9 @@ type AdmissionControllerFeatureConfig struct { | |||
// Default: "datadog-webhook" | |||
// +optional | |||
WebhookName *string `json:"webhookName,omitempty"` | |||
|
|||
//The registry enables setting a custom registry name on the admission controller. | |||
Registry *string `json:"registry,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is correspond to "clusterAgent.admissionController.containerRegistry" in helm chart.
controllers/datadogagent/feature/admissioncontroller/feature_test.go
Outdated
Show resolved
Hide resolved
Update docs/configuration.v2alpha1.md Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com> Update datadoghq.com_datadogagents.yaml Update datadoghq.com_datadogagents.yaml edited some code in features.go to check If there is a value on global.registry Edited comments for better clarification Edited some typos added AC test and deleted for v1alpha1 editing some AC test editing some AC test code changing AC test codes Changing variables in AC feature test code Adding global registry option test case for AC feature test Adding v1alpha1 test case back in AC feature test making empty commit making empty commit with signature
e8ee6c3
to
20f596d
Compare
/mergequeue |
Action not found: mergequeue If you need support, contact us on Slack #devflow! |
/merge |
Update docs/configuration.v2alpha1.md Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com> Update datadoghq.com_datadogagents.yaml Update datadoghq.com_datadogagents.yaml edited some code in features.go to check If there is a value on global.registry Edited comments for better clarification Edited some typos added AC test and deleted for v1alpha1 editing some AC test editing some AC test code changing AC test codes Changing variables in AC feature test code Adding global registry option test case for AC feature test Adding v1alpha1 test case back in AC feature test making empty commit making empty commit with signature
What does this PR do?
A brief description of the change being made with this pull request.
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: v7.51.0
Cluster Agent: v7.51.0
Describe your test plan
Test label overrides with < 1.7.0. (e.g. 1.6.0)
spec.global.registry
to “public.ecr.aws/datadog”.This configuration is applied for all agent image deployment, However, the init container image created by admission controller wasn’t affected by it.
In agent image deployment,
But not in sidecar container image.
e.g. init container by admission controller - Library injection.
Scenario 1
spec.global.registry
will now be affected to not only all agent images but also admission controller sidecar container image.This will end up adding an environment variable : DD_ADMISSION_CONTROLLER_CONTAINER_REGISTRY in the cluster agent.Scenario 2
Depending on the use-case, init container image can only be edited by specifying “
spec.features.admissionController.registry
”.This will take precedence over spec.global.registry. (which means, If both
spec.global.registry
andspec.features.admissionController.registry
are set, second one will be applied for init container.)features.admissionController.registry
takes precedence.Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label