-
Notifications
You must be signed in to change notification settings - Fork 98
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
Improve support for environment autodiscovery by removing explicit setting of DOCKER_HOST by default with Agent 7.27+ #303
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, documentation
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, documentation
api/v1alpha1/datadogagent_default.go
Outdated
// Don't default Docker/CRI paths with Agent >= 7.27.0 | ||
// Let Env AD do the work for us | ||
agentTag := utils.GetTagFromImageName(agent.Image.Name) | ||
if !(agentTag == "latest" || utils.IsAboveMinVersion(agentTag, "7.27.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.
does this support agent 6 and jmx images?
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.
Good catch, changed.
import "github.com/Masterminds/semver/v3" | ||
|
||
// IsAboveMinVersion uses semver to check if `version` is >= minVersion | ||
func IsAboveMinVersion(version, minVersion string) bool { |
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.
mind adding a unit test? 🙇
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
e0d0076
to
f119b3f
Compare
…tting of DOCKER_HOST by default with Agent 7.27+
f119b3f
to
d7b45a7
Compare
Codecov Report
@@ Coverage Diff @@
## main #303 +/- ##
==========================================
- Coverage 58.22% 56.28% -1.94%
==========================================
Files 59 60 +1
Lines 6300 6593 +293
==========================================
+ Hits 3668 3711 +43
- Misses 2362 2608 +246
- Partials 270 274 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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?
Describe your test plan
DOCKER_HOST
should not be set and/var/run
should be mounted to/host/var/run
DOCKER_HOST
should be set and/var/run
should be mounted to/host/var/run