mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
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:
@@ -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",
|
||||
],
|
||||
)
|
||||
|
||||
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user