-
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
[PROCS-3915] Add agent version check to Orchestrator Explorer feature to determine if process agent is required #1125
[PROCS-3915] Add agent version check to Orchestrator Explorer feature to determine if process agent is required #1125
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 #1125 +/- ##
==========================================
+ Coverage 58.98% 59.00% +0.01%
==========================================
Files 174 174
Lines 21386 21396 +10
==========================================
+ Hits 12615 12625 +10
Misses 8004 8004
Partials 767 767
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
@@ -116,6 +129,7 @@ func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (req | |||
func (f *orchestratorExplorerFeature) ConfigureV1(dda *v1alpha1.DatadogAgent) (reqComp feature.RequiredComponents) { | |||
f.owner = dda | |||
orchestratorExplorer := dda.Spec.Features.OrchestratorExplorer | |||
f.processAgentRequired = true |
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.
As far as I understand V1 is being deprecated. however this was done to maintain current behavior.
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.
LGTM
@@ -71,12 +75,21 @@ func (f *orchestratorExplorerFeature) ID() feature.IDType { | |||
func (f *orchestratorExplorerFeature) Configure(dda *v2alpha1.DatadogAgent) (reqComp feature.RequiredComponents) { | |||
f.owner = dda | |||
orchestratorExplorer := dda.Spec.Features.OrchestratorExplorer | |||
nodeAgent, ok := dda.Spec.Override[v2alpha1.NodeAgentComponentName] | |||
// Process Agent is not required on versions as of 7.51.0 | |||
f.processAgentRequired = ok && nodeAgent.Image != nil && !utils.IsAboveMinVersion(component.GetAgentVersionFromImage(*nodeAgent.Image), "7.51.0") |
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.
Any risk of *nodeAgent.Image
being nil?
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.
Hopefully someone from container-ecosystems can confirm, but if nodeAgent.Image
is not set then gcr.io/datadoghq/agent:latest
is being used for the image by default. Thus, I have that if *nodeAgent.Image
is nil, processAgentRequired
evaluates to false (latest is 7.51.0 as of now).
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.
for readability, do you mind structuring the conditional similar to how it's done here?
controllers/datadogagent/feature/orchestratorexplorer/feature.go
Outdated
Show resolved
Hide resolved
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.
just a couple small suggestions, thanks!
if nodeAgent, ok := dda.Spec.Override[v2alpha1.NodeAgentComponentName]; ok { | ||
if f.processAgentRequired = nodeAgent.Image != nil && | ||
!utils.IsAboveMinVersion(component.GetAgentVersionFromImage(*nodeAgent.Image), "7.51.0"); f.processAgentRequired { |
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.
sorry i wasn't clear in my comment earlier - here's my suggested edit:
if nodeAgent, ok := dda.Spec.Override[v2alpha1.NodeAgentComponentName]; ok { | |
if f.processAgentRequired = nodeAgent.Image != nil && | |
!utils.IsAboveMinVersion(component.GetAgentVersionFromImage(*nodeAgent.Image), "7.51.0"); f.processAgentRequired { | |
if nodeAgent, ok := dda.Spec.Override[v2alpha1.NodeAgentComponentName]; ok { | |
if nodeAgent.Image != nil && !utils.IsAboveMinVersion(component.GetAgentVersionFromImage(*nodeAgent.Image), "7.51.0") { | |
f.processAgentRequired = true |
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.
Done
if nodeAgent, ok := dda.Spec.Override[v2alpha1.NodeAgentComponentName]; ok { | ||
if f.processAgentRequired = nodeAgent.Image != nil && | ||
!utils.IsAboveMinVersion(component.GetAgentVersionFromImage(*nodeAgent.Image), "7.51.0"); f.processAgentRequired { |
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 we put the minimum agent version in a constant?
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.
Done
9cf434c
to
3072e4e
Compare
/merge |
🚂 MergeQueue This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Use |
/remove |
🚂 Devflow: |
This merge request was unqueued If you need support, contact us on Slack #ci-interfaces! |
/merge |
🚂 MergeQueue This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals. Use |
/remove |
🚂 Devflow: |
This merge request was unqueued If you need support, contact us on Slack #ci-interfaces! |
… to determine if process agent is required (#1125) * Add agent version check to orchestrator explorer * Add unit tests for agent version checks * Add unit tests for agent version checks * fix v1 tests * Fix generated files * Update agent check logic * min version var
What does this PR do?
This PR adds an agent version check to the Orchestrator Explorer feature to determine if the process agent container should be required. This container is no longer required for this feature as of 7.51.0.
Motivation
This behavior blocked our work to run in the process checks in the core agent. This was due to the orchestrator explorer feature always requiring the process agent container when now runs no checks. Thus, When the process checks run in the core agent, there are no checks running and the process agent exits resulting in a crash loop.
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?
Describe your test plan
Agent Version < 7.51.0
Start the operator and configure the agent to: use a version less than 7.51.0, enable the
orchestratorExplorer
, and disable all Processes features. Verify the process agent container is included in the agent pod.Agent Version >= 7.51.0
Start the operator and configure the agent to: use a version greather than or equal to 7.51.0, enable the
orchestratorExplorer
, and disable all Processes features. Verify the process agent container is no longer included in the agent pod.Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label