init: add cluster version to kubernetes components

This commit is contained in:
Leonard Cohnen 2023-01-04 17:03:40 +01:00 committed by 3u13r
parent 4803edd4a0
commit 25c3a8a1f3
7 changed files with 22 additions and 26 deletions

View file

@ -12,7 +12,6 @@ import (
"github.com/edgelesssys/constellation/v2/bootstrapper/internal/kubelet"
"github.com/edgelesssys/constellation/v2/internal/constants"
"github.com/edgelesssys/constellation/v2/internal/kubernetes"
"github.com/edgelesssys/constellation/v2/internal/versions"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeletconf "k8s.io/kubelet/config/v1beta1"
@ -33,7 +32,7 @@ const (
type KubdeadmConfiguration struct{}
// InitConfiguration returns a new init configuration.
func (c *KubdeadmConfiguration) InitConfiguration(externalCloudProvider bool, k8sVersion versions.ValidK8sVersion) KubeadmInitYAML {
func (c *KubdeadmConfiguration) InitConfiguration(externalCloudProvider bool, clusterVersion string) KubeadmInitYAML {
var cloudProvider string
if externalCloudProvider {
cloudProvider = "external"
@ -63,7 +62,7 @@ func (c *KubdeadmConfiguration) InitConfiguration(externalCloudProvider bool, k8
APIVersion: kubeadm.SchemeGroupVersion.String(),
},
// Target kubernetes version of the control plane.
KubernetesVersion: versions.VersionConfigs[k8sVersion].PatchVersion,
KubernetesVersion: clusterVersion,
// necessary to be able to access the kubeapi server through localhost
APIServer: kubeadm.APIServer{
ControlPlaneComponent: kubeadm.ControlPlaneComponent{