Skip to content

Commit 4ca062b

Browse files
authored
Use Agent 7.64.3 fixed version and explicitly cast to Integer to avoid eval error (#865)
1 parent cce8020 commit 4ca062b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

environments/etc/manifests/site.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node default {
22
class { 'datadog_agent':
33
api_key => 'somenonnullapikeythats32charlong',
4+
# Pin the Agent version to 7.64.3 to avoid breaking changes in postint for kitchen tests
5+
agent_version => '7.64.3',
46
agent_extra_options => {
57
use_http => true,
68
},

manifests/redhat.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
#In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1'
2121
if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' {
22-
if $agent_major_version >= 6 and ($agent_version == 'latest' or 0 + $3 > 35) {
22+
if $agent_major_version >= 6 and ($agent_version == 'latest' or Integer($3, 10) > 35) {
2323
$keys = $all_keys[0,3]
2424
} else {
2525
$keys = $all_keys

manifests/suse.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
#In this regex, version '1:6.15.0~rc.1-1' would match as $1='1:', $2='6', $3='15', $4='0', $5='~rc.1', $6='1'
2121
if $agent_version =~ /([0-9]+:)?([0-9]+)\.([0-9]+)\.([0-9]+)((?:~|-)[^0-9\s-]+[^-\s]*)?(?:-([0-9]+))?/ or $agent_version == 'latest' {
22-
if $agent_major_version >= 6 and ($agent_version == 'latest' or 0 + $3 > 35) {
22+
if $agent_major_version >= 6 and ($agent_version == 'latest' or Integer($3, 10) > 35) {
2323
$keys_to_use = $all_keys[0,3]
2424
} else {
2525
$keys_to_use = $all_keys

0 commit comments

Comments
 (0)