Skip to content

Commit 75b70d8

Browse files
committed
Remove 'keyring_force_update' since not indempotent
1 parent e5eab76 commit 75b70d8

File tree

5 files changed

+0
-30
lines changed

5 files changed

+0
-30
lines changed

manifests/init.pp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@
351351
# Absolute path to a file containing the PGP keyring used to sign this repository. Value is used to set signed-by on the source entry.
352352
# See https://wiki.debian.org/DebianRepository/UseThirdParty for details.
353353
#
354-
# @param keyring_force_update
355-
# Forces to update the with keyring provided gpg key.
356-
#
357354
class docker (
358355
Optional[String] $version = $docker::params::version,
359356
String $ensure = $docker::params::ensure,
@@ -473,7 +470,6 @@
473470
Optional[Variant[String,Array]] $registry_mirror = $docker::params::registry_mirror,
474471
Boolean $acknowledge_unsupported_os = false,
475472
Stdlib::Absolutepath $keyring = '/etc/apt/keyrings/docker.gpg',
476-
Boolean $keyring_force_update = false,
477473

478474
# Windows specific parameters
479475
Optional[String] $docker_msft_provider_version = $docker::params::docker_msft_provider_version,

manifests/repos.pp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
# @param gpg_ensure
1616
# Whether or not the gpg package is ensured by this module.
1717
#
18-
# @param keyring_force_update
19-
# Forces to update the with keyring provided gpg key.
2018
class docker::repos (
2119
$location = $docker::package_location,
2220
$key_source = $docker::package_key_source,
2321
$key_check_source = $docker::package_key_check_source,
2422
$architecture = $facts['os']['architecture'],
2523
$keyring = $docker::keyring,
2624
$gpg_ensure = $docker::params::gpg_ensure,
27-
$keyring_force_update = $docker::keyring_force_update,
2825
) {
2926
ensure_packages($docker::prerequired_packages)
3027

@@ -40,14 +37,6 @@
4037
if $gpg_ensure {
4138
ensure_packages(['gpg'])
4239
}
43-
if $keyring_force_update {
44-
exec { 'Remove Docker-GPG-Key':
45-
path => '/bin/',
46-
cwd => '/tmp',
47-
command => "rm ${keyring}",
48-
}
49-
Exec['Remove Docker-GPG-Key'] -> Archive[$keyring]
50-
}
5140

5241
archive { $keyring:
5342
ensure => present,

spec/classes/init_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
'with keyring set to optional path' => {
3434
'keyring' => '/root/keyrings/docker.gpg',
3535
},
36-
'with keyring set to force update' => {
37-
'keyring_force_update' => true,
38-
},
3936
}
4037

4138
describe 'docker', type: :class do
@@ -187,7 +184,6 @@
187184
'use_upstream_package_source' => defaults['use_upstream_package_source'],
188185
'version' => defaults['version'],
189186
'keyring' => defaults['keyring'],
190-
'keyring_force_update' => defaults['keyring_force_update'],
191187
}.merge(default_params).merge(local_params)
192188

193189
let(:facts) do

spec/helper/get_defaults.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ def get_defaults(_facts)
8989
tmp_dir_config = true
9090
version = :undef
9191
keyring = '/etc/apt/keyrings/docker.gpg'
92-
keyring_force_update = false
9392

9493
if _facts[:os]['family'] == 'windows'
9594
compose_install_path = "#{_facts['docker_program_files_path']}/Docker"
@@ -490,6 +489,5 @@ def get_defaults(_facts)
490489
'use_upstream_package_source' => use_upstream_package_source,
491490
'version' => version,
492491
'keyring' => keyring,
493-
'keyring_force_update' => keyring_force_update,
494492
}
495493
end

spec/shared_examples/repos.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@
3131
if params['use_upstream_package_source']
3232
# check if debian version is atleast 11 and ubuntu version is atleast 22
3333
if (facts[:operatingsystem] == 'Debian' && facts[:operatingsystemrelease] =~ /1[1-9]/) || (facts[:operatingsystem] == 'Ubuntu' && facts[:operatingsystemrelease] =~ /2[2-9]/)
34-
if params['keyring_force_update']
35-
it {
36-
is_expected.to contain_exec('Remove Docker-GPG-Key').with(
37-
'path' => '/bin/',
38-
'cwd' => '/tmp',
39-
'command' => "rm #{keyring}",
40-
).that_comes_before("Archive[#{keyring}]")
41-
}
42-
end
4334
it {
4435
is_expected.to contain_class('archive')
4536
is_expected.to contain_archive(keyring)

0 commit comments

Comments
 (0)