@@ -27,7 +27,6 @@ import (
27
27
"github.com/pkg/errors"
28
28
"k8s.io/api/core/v1"
29
29
"k8s.io/apimachinery/pkg/util/intstr"
30
- "k8s.io/apimachinery/pkg/util/version"
31
30
"k8s.io/klog"
32
31
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
33
32
kubeadmconstants "k8s.io/kubernetes/cmd/kubeadm/app/constants"
@@ -47,7 +46,7 @@ func CreateInitStaticPodManifestFiles(manifestDir string, cfg *kubeadmapi.InitCo
47
46
48
47
// GetStaticPodSpecs returns all staticPodSpecs actualized to the context of the current configuration
49
48
// NB. this methods holds the information about how kubeadm creates static pod manifests.
50
- func GetStaticPodSpecs (cfg * kubeadmapi.ClusterConfiguration , endpoint * kubeadmapi.APIEndpoint , k8sVersion * version. Version ) map [string ]v1.Pod {
49
+ func GetStaticPodSpecs (cfg * kubeadmapi.ClusterConfiguration , endpoint * kubeadmapi.APIEndpoint ) map [string ]v1.Pod {
51
50
// Get the required hostpath mounts
52
51
mounts := getHostPathVolumesForTheControlPlane (cfg )
53
52
@@ -67,7 +66,7 @@ func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmap
67
66
Name : kubeadmconstants .KubeControllerManager ,
68
67
Image : images .GetKubernetesImage (kubeadmconstants .KubeControllerManager , cfg ),
69
68
ImagePullPolicy : v1 .PullIfNotPresent ,
70
- Command : getControllerManagerCommand (cfg , k8sVersion ),
69
+ Command : getControllerManagerCommand (cfg ),
71
70
VolumeMounts : staticpodutil .VolumeMountMapToSlice (mounts .GetVolumeMounts (kubeadmconstants .KubeControllerManager )),
72
71
LivenessProbe : livenessProbe (staticpodutil .GetControllerManagerProbeAddress (cfg ), kubeadmconstants .InsecureKubeControllerManagerPort , v1 .URISchemeHTTP ),
73
72
Resources : staticpodutil .ComponentResources ("200m" ),
@@ -105,15 +104,9 @@ func livenessProbe(host string, port int, scheme v1.URIScheme) *v1.Probe {
105
104
106
105
// CreateStaticPodFiles creates all the requested static pod files.
107
106
func CreateStaticPodFiles (manifestDir string , cfg * kubeadmapi.ClusterConfiguration , endpoint * kubeadmapi.APIEndpoint , componentNames ... string ) error {
108
- // TODO: Move the "pkg/util/version".Version object into the internal API instead of always parsing the string
109
- k8sVersion , err := version .ParseSemantic (cfg .KubernetesVersion )
110
- if err != nil {
111
- return err
112
- }
113
-
114
107
// gets the StaticPodSpecs, actualized for the current ClusterConfiguration
115
108
klog .V (1 ).Infoln ("[control-plane] getting StaticPodSpecs" )
116
- specs := GetStaticPodSpecs (cfg , endpoint , k8sVersion )
109
+ specs := GetStaticPodSpecs (cfg , endpoint )
117
110
118
111
// creates required static pod specs
119
112
for _ , componentName := range componentNames {
@@ -262,7 +255,7 @@ func calcNodeCidrSize(podSubnet string) string {
262
255
}
263
256
264
257
// getControllerManagerCommand builds the right controller manager command from the given config object and version
265
- func getControllerManagerCommand (cfg * kubeadmapi.ClusterConfiguration , k8sVersion * version. Version ) []string {
258
+ func getControllerManagerCommand (cfg * kubeadmapi.ClusterConfiguration ) []string {
266
259
267
260
kubeconfigFile := filepath .Join (kubeadmconstants .KubernetesDir , kubeadmconstants .ControllerManagerKubeConfigFileName )
268
261
caFile := filepath .Join (cfg .CertificatesDir , kubeadmconstants .CACertName )
0 commit comments