kubeadm: Deprecate hyperkube use

As the hyperkube image is itself deprecated and moved out of tree, its use with
kubeadm gets deprecated too. Hence, deprecation messages will be printed when
it is used.

Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
This commit is contained in:
Rostislav M. Georgiev 2019-11-11 17:03:25 +02:00
parent b2fb0f77ad
commit 5bb80694ec
2 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@ go_library(
"//cmd/kubeadm/app/apis/kubeadm:go_default_library",
"//cmd/kubeadm/app/constants:go_default_library",
"//cmd/kubeadm/app/util:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],
)

View File

@ -19,6 +19,7 @@ package images
import (
"fmt"
"k8s.io/klog"
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
@ -32,7 +33,8 @@ func GetGenericImage(prefix, image, tag string) string {
// GetKubernetesImage generates and returns the image for the components managed in the Kubernetes main repository,
// including the control-plane components and kube-proxy. If specified, the HyperKube image will be used.
func GetKubernetesImage(image string, cfg *kubeadmapi.ClusterConfiguration) string {
if cfg.UseHyperKubeImage {
if cfg.UseHyperKubeImage && image != constants.HyperKube {
klog.Warningf(`WARNING: DEPRECATED use of the "hyperkube" image in place of %q`, image)
image = constants.HyperKube
}
repoPrefix := cfg.GetControlPlaneImageRepository()
@ -91,6 +93,7 @@ func GetControlPlaneImages(cfg *kubeadmapi.ClusterConfiguration) []string {
// start with core kubernetes images
if cfg.UseHyperKubeImage {
klog.Warningln(`WARNING: DEPRECATED use of the "hyperkube" image for the Kubernetes control plane`)
imgs = append(imgs, GetKubernetesImage(constants.HyperKube, cfg))
} else {
imgs = append(imgs, GetKubernetesImage(constants.KubeAPIServer, cfg))