mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 22:34:56 -04:00
cli: skip k8s upgrade in case of outdated version (#1864)
If an unsupported, outdated k8s patch version is used, the user should still be able to run upgrade apply.
This commit is contained in:
parent
eb9bea1cff
commit
6bda62d397
9 changed files with 107 additions and 16 deletions
|
@ -127,9 +127,11 @@ func (i *initCmd) initialize(cmd *cobra.Command, newDialer func(validator atls.V
|
|||
return fmt.Errorf("reading cluster ID file: %w", err)
|
||||
}
|
||||
|
||||
k8sVersion, err := versions.NewValidK8sVersion(compatibility.EnsurePrefixV(conf.KubernetesVersion))
|
||||
// config validation does not check k8s patch version since upgrade may accept an outdated patch version.
|
||||
// init only supported up-to-date versions.
|
||||
k8sVersion, err := versions.NewValidK8sVersion(compatibility.EnsurePrefixV(conf.KubernetesVersion), true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("validating kubernetes version: %w", err)
|
||||
return fmt.Errorf("invalid Kubernetes version: %s", conf.KubernetesVersion)
|
||||
}
|
||||
i.log.Debugf("Validated k8s version as %s", k8sVersion)
|
||||
if versions.IsPreviewK8sVersion(k8sVersion) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue