Stop trying to populate arbitrary cluster fields from the channel

This commit is contained in:
John Gardiner Myers 2022-11-29 21:15:09 -08:00
parent 0b24fc108a
commit 31dbd6c50a
2 changed files with 3 additions and 15 deletions

View File

@ -352,15 +352,6 @@ func RecommendedKubernetesVersion(c *Channel, kopsVersionString string) *semver.
}
}
if c.Spec.Cluster != nil {
sv, err := util.ParseKubernetesVersion(c.Spec.Cluster.KubernetesVersion)
if err != nil {
klog.Warningf("unable to parse kubernetes version %q", c.Spec.Cluster.KubernetesVersion)
} else {
return sv
}
}
return nil
}

View File

@ -202,16 +202,13 @@ func NewCluster(opt *NewClusterOptions, clientset simple.Clientset) (*NewCluster
},
}
if channel.Spec.Cluster != nil {
cluster.Spec = *channel.Spec.Cluster
cluster.Spec.Channel = opt.Channel
if opt.KubernetesVersion == "" {
kubernetesVersion := api.RecommendedKubernetesVersion(channel, kops.Version)
if kubernetesVersion != nil {
cluster.Spec.KubernetesVersion = kubernetesVersion.String()
}
}
cluster.Spec.Channel = opt.Channel
if opt.KubernetesVersion != "" {
} else {
cluster.Spec.KubernetesVersion = opt.KubernetesVersion
}