Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise errors earlier if we cannot parse the kube version #16625

Merged
Merged
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
7 changes: 7 additions & 0 deletions upup/pkg/fi/cloudup/new_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ func NewCluster(opt *NewClusterOptions, clientset simple.Clientset) (*NewCluster
cluster.Spec.KubernetesVersion = opt.KubernetesVersion
}

// Verify the kubernetes version early (while we can still handle the version nicely)
if cluster.Spec.KubernetesVersion != "" {
if _, err := util.ParseKubernetesVersion(cluster.Spec.KubernetesVersion); err != nil {
return nil, fmt.Errorf("cannot parse KubernetesVersion %q: %w", cluster.Spec.KubernetesVersion, err)
}
}

cluster.Spec.ConfigStore = api.ConfigStoreSpec{
Base: opt.ConfigBase,
}
Expand Down
Loading