Skip to content

Commit

Permalink
Fix after reviews
Browse files Browse the repository at this point in the history
Signed-off-by: Artiom Diomin <[email protected]>
  • Loading branch information
kron4eg committed Apr 29, 2021
1 parent 6a8969e commit 753f677
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/scripts/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var (
sudo rm -rf /etc/kubernetes/encryption-providers
sudo rm -rf /var/lib/etcd/
sudo rm -rf "{{ .WORK_DIR }}"
sudo rm -rf /etc/kubeone
`)

kubeadmUpgradeLeaderScriptTemplate = heredoc.Doc(`
Expand Down
1 change: 1 addition & 0 deletions pkg/scripts/testdata/TestKubeadmReset-not-verbose.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ sudo rm -rf /etc/kubernetes/admission
sudo rm -rf /etc/kubernetes/encryption-providers
sudo rm -rf /var/lib/etcd/
sudo rm -rf "test-wd"
sudo rm -rf /etc/kubeone
1 change: 1 addition & 0 deletions pkg/scripts/testdata/TestKubeadmReset-verbose.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ sudo rm -rf /etc/kubernetes/admission
sudo rm -rf /etc/kubernetes/encryption-providers
sudo rm -rf /var/lib/etcd/
sudo rm -rf "test-wd"
sudo rm -rf /etc/kubeone
4 changes: 4 additions & 0 deletions pkg/tasks/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func earliestCertExpiry(conn ssh.Connection) (time.Time, error) {
}

func ensureCABundleConfigMap(s *state.State) error {
if s.DynamicClient == nil {
return errors.New("kubernetes client not initialized")
}

s.Logger.Infoln("Creating ca-bundle configMap...")

cm := cabundle.ConfigMap(s.Cluster.CABundle)
Expand Down
2 changes: 1 addition & 1 deletion pkg/tasks/prerequisites.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func installKubeadmFlatcar(s *state.State) error {
}

func uploadConfigurationFiles(s *state.State) error {
return s.RunTaskOnControlPlane(uploadConfigurationFilesToNode, state.RunParallel)
return s.RunTaskOnAllNodes(uploadConfigurationFilesToNode, state.RunParallel)
}

func uploadConfigurationFilesToNode(s *state.State, node *kubeoneapi.HostConfig, conn ssh.Connection) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func WithFullInstall(t Tasks) Tasks {
append(Tasks{
{
Fn: func(s *state.State) error {
s.Logger.Infoln("Configuring certs and etcd on first controller...")
s.Logger.Infoln("Configuring certs and etcd on control plane node...")
return s.RunTaskOnLeader(kubeadmCertsExecutor)
},
ErrMsg: "failed to provision certs and etcd on leader",
Expand All @@ -130,7 +130,7 @@ func WithFullInstall(t Tasks) Tasks {
},
{
Fn: func(s *state.State) error {
s.Logger.Infoln("Configuring certs and etcd on consecutive controller...")
s.Logger.Infoln("Configuring certs and etcd on consecutive control plane node...")
return s.RunTaskOnFollowers(kubeadmCertsExecutor, state.RunParallel)
},
ErrMsg: "failed to provision certs and etcd on followers",
Expand Down

0 comments on commit 753f677

Please sign in to comment.