diff --git a/cmd/kubeadm/app/images/BUILD b/cmd/kubeadm/app/images/BUILD index cc9aeb381ce..c66a9c039ec 100644 --- a/cmd/kubeadm/app/images/BUILD +++ b/cmd/kubeadm/app/images/BUILD @@ -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", ], ) diff --git a/cmd/kubeadm/app/images/images.go b/cmd/kubeadm/app/images/images.go index 33ca05015a6..4ecbc445b35 100644 --- a/cmd/kubeadm/app/images/images.go +++ b/cmd/kubeadm/app/images/images.go @@ -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))