Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions manifests/server/tls/cert.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@
if $ensure == 'present' {
Package <| title == 'openssl' |>
-> exec {
default:
path => $facts['path'];

"Create K8s ${title} key":
command => "openssl genrsa -out '${key}' ${key_bits}; echo > '${cert}'",
unless => "openssl pkey -in '${key}' -text | grep '${key_bits} bit'",
path => $facts['path'],
before => File[$key],
notify => Exec["Create K8s ${title} CSR"];

"Create K8s ${title} CSR":
command => "openssl req -new -key '${key}' \
-out '${csr}' -config '${$config}'; echo > '${cert}'",
path => $facts['path'],
refreshonly => true,
notify => Exec["Sign K8s ${title} cert"],
require => File[$key],
Expand All @@ -84,6 +83,7 @@
-out '${cert}' -days '${valid_days}' \
-extensions v3_req -extfile '${config}'",
unless => "openssl verify -CAfile '${ca_cert}' '${cert}'",
path => $facts['path'],
require => [
File[$csr],
File[$key],
Expand Down
3 changes: 1 addition & 2 deletions spec/unit/puppet/provider/kubeconfig/kubectl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def self.message(*_); end
],
'current-context' => 'default',
'kind' => 'Config',
'preferences' => {},
}
end

Expand Down Expand Up @@ -125,7 +124,7 @@ def self.message(*_); end
catalog.apply

data = Psych.load(File.read(tmpfile))
expect(data).to eq default_kubeconfig
expect(data.slice(*default_kubeconfig.keys)).to eq default_kubeconfig
end
end
end
Expand Down
Loading