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:
Otto Bittner 2023-06-05 09:13:02 +02:00 committed by GitHub
parent eb9bea1cff
commit 6bda62d397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 107 additions and 16 deletions

View file

@ -247,9 +247,9 @@ func (c *Client) upgradeRelease(
) error {
// We need to load all values that can be statically loaded before merging them with the cluster
// values. Otherwise the templates are not rendered correctly.
k8sVersion, err := versions.NewValidK8sVersion(conf.KubernetesVersion)
k8sVersion, err := versions.NewValidK8sVersion(conf.KubernetesVersion, true)
if err != nil {
return fmt.Errorf("invalid k8s version: %w", err)
return fmt.Errorf("validating k8s version: %s", conf.KubernetesVersion)
}
loader := NewLoader(conf.GetProvider(), k8sVersion)