Skip to content

Commit 229a90a

Browse files
authored
Merge pull request #144 from ananace/idempotency-change
Un-DRY execs to avoid puppet-lint failures
2 parents 3cbc30b + e2bd8a3 commit 229a90a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

manifests/server/tls/cert.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,17 @@
6161
if $ensure == 'present' {
6262
Package <| title == 'openssl' |>
6363
-> exec {
64-
default:
65-
path => $facts['path'];
66-
6764
"Create K8s ${title} key":
6865
command => "openssl genrsa -out '${key}' ${key_bits}; echo > '${cert}'",
6966
unless => "openssl pkey -in '${key}' -text | grep '${key_bits} bit'",
67+
path => $facts['path'],
7068
before => File[$key],
7169
notify => Exec["Create K8s ${title} CSR"];
7270

7371
"Create K8s ${title} CSR":
7472
command => "openssl req -new -key '${key}' \
7573
-out '${csr}' -config '${$config}'; echo > '${cert}'",
74+
path => $facts['path'],
7675
refreshonly => true,
7776
notify => Exec["Sign K8s ${title} cert"],
7877
require => File[$key],
@@ -84,6 +83,7 @@
8483
-out '${cert}' -days '${valid_days}' \
8584
-extensions v3_req -extfile '${config}'",
8685
unless => "openssl verify -CAfile '${ca_cert}' '${cert}'",
86+
path => $facts['path'],
8787
require => [
8888
File[$csr],
8989
File[$key],

spec/unit/puppet/provider/kubeconfig/kubectl_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def self.message(*_); end
6767
],
6868
'current-context' => 'default',
6969
'kind' => 'Config',
70-
'preferences' => {},
7170
}
7271
end
7372

@@ -125,7 +124,7 @@ def self.message(*_); end
125124
catalog.apply
126125

127126
data = Psych.load(File.read(tmpfile))
128-
expect(data).to eq default_kubeconfig
127+
expect(data.slice(*default_kubeconfig.keys)).to eq default_kubeconfig
129128
end
130129
end
131130
end

0 commit comments

Comments
 (0)