Skip to content

Commit

Permalink
Merge pull request #592 from puppetlabs/maint-addressing_unless_typos
Browse files Browse the repository at this point in the history
(MAINT) Addressing wrong type for unless execs
  • Loading branch information
jordanbreen28 authored Dec 5, 2022
2 parents 8ce4405 + 911bec3 commit 7238ba0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions manifests/kube_addons.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if $cni_network_preinstall {
$preinstall_command = ['kubectl', 'apply', '-f', $cni_network_preinstall]
$preinstall_onlyif = ['kubectl', 'get', 'nodes']
$preinstall_unless = [["kubectl -n tigera-operator get deployments | egrep '^tigera-operator'"]]
$preinstall_unless = "kubectl -n tigera-operator get deployments | egrep '^tigera-operator'"

exec { 'Install cni network (preinstall)':
command => $preinstall_command,
Expand All @@ -56,7 +56,7 @@
$calico_installation_path = '/etc/kubernetes/calico-installation.yaml'
$path_command = ['kubectl', 'apply', '-f', '/etc/kubernetes/calico-installation.yaml']
$path_onlyif = ['kubectl', 'get', 'nodes']
$path_unless = [["kubectl -n calico-system get daemonset | egrep '^calico-node'"]]
$path_unless = "kubectl -n calico-system get daemonset | egrep '^calico-node'"

file { $calico_installation_path:
ensure => 'present',
Expand All @@ -81,7 +81,7 @@
} else {
$provider_command = ['kubectl', 'apply', '-f', $cni_network_provider]
$provider_onlyif = ['kubectl', 'get', 'nodes']
$provider_unless = [["kubectl -n kube-system get daemonset | egrep '(flannel|weave|calico-node|cilium)'"]]
$provider_unless = "kubectl -n kube-system get daemonset | egrep '(flannel|weave|calico-node|cilium)'"

exec { 'Install cni network provider':
command => $provider_command,
Expand All @@ -98,7 +98,7 @@

if $schedule_on_controller {
$schedule_command = ['kubectl', 'taint', 'nodes', $node_name, 'node-role.kubernetes.io/master-']
$schedule_onlyif = ["kubectl describe nodes ${node_name} | tr -s ' ' | grep 'Taints: node-role.kubernetes.io/master:NoSchedule'"]
$schedule_onlyif = "kubectl describe nodes ${node_name} | tr -s ' ' | grep 'Taints: node-role.kubernetes.io/master:NoSchedule'"

exec { 'schedule on controller':
command => $schedule_command,
Expand Down
3 changes: 1 addition & 2 deletions manifests/kubeadm_init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
})

$exec_init = ['kubeadm', 'init', $kubeadm_init_flags]
$unless_init = [["kubectl get nodes | grep ${node_name}"]]

$unless_init = "kubectl get nodes | grep ${node_name}"
exec { 'kubeadm init':
command => $exec_init,
environment => $env,
Expand Down
2 changes: 1 addition & 1 deletion manifests/kubeadm_join.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
}

$exec_join = ['kubeadm', 'join', $kubeadm_join_flags]
$unless_join = [["kubectl get nodes | grep ${node_name}"]]
$unless_join = "kubectl get nodes | grep ${node_name}"

exec { 'kubeadm join':
command => $exec_join,
Expand Down

0 comments on commit 7238ba0

Please sign in to comment.