File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 6565 if $agent_version == ' latest' {
6666 $ensure_version = ' installed'
6767 } else {
68- # While artifacts contain X.Y.Z in their name, their installed Windows versions are actually X.Y.Z.1
69- $ensure_version = " ${agent_version} .1"
68+ # While artifacts contain X.Y.Z in their name, their installed Windows versions are actually X.Y.Z.1 before 7.47.0.
69+ # After 7.47.0, the version is X.Y.Z.0.
70+ # Ref: https://github.com/DataDog/datadog-agent/pull/19576
71+ $version_parts = split($agent_version , ' [.]' ) # . is a meta regex character, so we need to escape it with [].
72+ if length($version_parts ) < 2 {
73+ fail(" Invalid version format: ${agent_version} . Expected format: X.Y.Z" )
74+ }
75+
76+ $minor_version = Integer($version_parts [1])
77+
78+ if $minor_version <= 46 {
79+ $ensure_version = " ${agent_version} .1"
80+ } else {
81+ $ensure_version = " ${agent_version} .0"
82+ }
7083 }
7184
7285 $hostname_option = $hostname ? { ' ' => {}, default => { ' HOSTNAME' => $hostname } }
You can’t perform that action at this time.
0 commit comments