Merge pull request #85094 from rosti/kubeadm-hyperkube-deprecation-notice

kubeadm: Deprecate hyperkube use
This commit is contained in:
Kubernetes Prow Robot 2019-11-11 08:53:41 -08:00 committed by GitHub
commit 0968636760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))