Skip to content

Commit b97f8fb

Browse files
olivielpeautruthbk
authored andcommitted
[apt] Stop installing old apt key (DataDog#406)
* [apt] Stop installing old apt key That key is not used anymore, let's stop installing it * Remove occurence of `other_keys`
1 parent e6e4d16 commit b97f8fb

3 files changed

Lines changed: 4 additions & 13 deletions

File tree

manifests/ubuntu/agent5.pp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
class datadog_agent::ubuntu::agent5(
1616
String $apt_key = 'A2923DFF56EDA6E76E55E492D3A80E30382E94DE',
1717
String $agent_version = 'latest',
18-
Array $other_keys = ['935F5A436A5A6E8788F0765B226AE980C7A7DA52'],
1918
String $location = $datadog_agent::params::agent5_default_repo,
2019
String $release = $datadog_agent::params::apt_default_release,
2120
String $repos = 'main',
@@ -25,12 +24,9 @@
2524
) inherits datadog_agent::params{
2625

2726
ensure_packages(['apt-transport-https'])
28-
validate_legacy('Array', 'validate_array', $other_keys)
2927

3028
if !$skip_apt_key_trusting {
31-
$mykeys = concat($other_keys, [$apt_key])
32-
33-
::datadog_agent::ubuntu::install_key { $mykeys:
29+
::datadog_agent::ubuntu::install_key { [$apt_key]:
3430
before => Apt::Source['datadog'],
3531
}
3632
}

manifests/ubuntu/agent6.pp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
class datadog_agent::ubuntu::agent6(
77
$apt_key = 'A2923DFF56EDA6E76E55E492D3A80E30382E94DE',
88
$agent_version = 'latest',
9-
$other_keys = ['935F5A436A5A6E8788F0765B226AE980C7A7DA52'],
109
$location = $datadog_agent::params::agent6_default_repo,
1110
$release = $datadog_agent::params::apt_default_release,
1211
$repos = '6',
@@ -16,12 +15,8 @@
1615
) inherits datadog_agent::params {
1716

1817
ensure_packages(['apt-transport-https'])
19-
validate_legacy(Array, 'validate_array', $other_keys)
20-
2118
if !$skip_apt_key_trusting {
22-
$mykeys = concat($other_keys, [$apt_key])
23-
24-
::datadog_agent::ubuntu::install_key { $mykeys:
19+
::datadog_agent::ubuntu::install_key { [$apt_key]:
2520
before => Apt::Source['datadog6'],
2621
}
2722
}

spec/classes/datadog_agent_ubuntu_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
end
1717

1818
# it should install the mirror
19-
it { should contain_datadog_agent__ubuntu__install_key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
19+
it { should_not contain_datadog_agent__ubuntu__install_key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
2020
it { should contain_datadog_agent__ubuntu__install_key('A2923DFF56EDA6E76E55E492D3A80E30382E94DE') }
2121
it do
2222
should contain_file('/etc/apt/sources.list.d/datadog.list')\
@@ -63,7 +63,7 @@
6363
end
6464

6565
# it should install the mirror
66-
it { should contain_datadog_agent__ubuntu__install_key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
66+
it { should_not contain_datadog_agent__ubuntu__install_key('935F5A436A5A6E8788F0765B226AE980C7A7DA52') }
6767
it { should contain_datadog_agent__ubuntu__install_key('A2923DFF56EDA6E76E55E492D3A80E30382E94DE') }
6868

6969
it do

0 commit comments

Comments
 (0)