Skip to content

Commit

Permalink
better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Sep 12, 2023
1 parent db7d2c5 commit b48f791
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cli/internal/kubecmd/kubecmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,12 @@ func (k *KubeCmd) UpgradeK8sVersion(ctx context.Context, k8sVersion versions.Val
string(k8sVersion), fmt.Errorf("no version config matching K8s %s", k8sVersion))
}
components, err = k.updateK8s(&nodeVersion, versionConfig.ClusterVersion, versionConfig.KubernetesComponents, force)
if err == nil {
err = k.applyComponentsCM(ctx, components)
if err != nil {
return fmt.Errorf("applying k8s components ConfigMap: %w", err)
}
if err != nil {
return fmt.Errorf("updating K8s: %w", err)
}
if err := k.applyComponentsCM(ctx, components); err != nil {
return fmt.Errorf("applying k8s components ConfigMap: %w", err)
}
fmt.Println("Successfully updated Kubernetes version", nodeVersion.Spec.KubernetesClusterVersion, "conf", k8sVersion)
updatedNodeVersion, err := k.applyNodeVersion(ctx, nodeVersion)
if err != nil {
return fmt.Errorf("applying upgrade: %w", err)
Expand Down

0 comments on commit b48f791

Please sign in to comment.