generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/align-fields-with-provisioner-provider
- Loading branch information
Showing
5 changed files
with
46 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package extender | ||
|
||
import ( | ||
gardener "github.com/gardener/gardener/pkg/apis/core/v1beta1" | ||
imv1 "github.com/kyma-project/infrastructure-manager/api/v1" | ||
"k8s.io/utils/ptr" | ||
) | ||
|
||
// NewKubernetesExtender creates a new Kubernetes extender function. | ||
// It sets the Kubernetes version of the Shoot to the version specified in the Runtime. | ||
// If the version is not specified in the Runtime, it sets the version to the `defaultKubernetesVersion`, set in `converter_config.json`. | ||
// It sets the EnableStaticTokenKubeconfig field of the Shoot to false. | ||
func NewKubernetesExtender(defaultKubernetesVersion string) func(runtime imv1.Runtime, shoot *gardener.Shoot) error { | ||
return func(runtime imv1.Runtime, shoot *gardener.Shoot) error { | ||
kubernetesVersion := runtime.Spec.Shoot.Kubernetes.Version | ||
if kubernetesVersion == nil || *kubernetesVersion == "" { | ||
kubernetesVersion = &defaultKubernetesVersion | ||
} | ||
|
||
shoot.Spec.Kubernetes.Version = *kubernetesVersion | ||
shoot.Spec.Kubernetes.EnableStaticTokenKubeconfig = ptr.To(false) | ||
|
||
return nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters