Skip to content

Commit ec4840f

Browse files
committed
kubeadm: Amend the hyperkube deprecation change
The PR introducing 5bb8069 got merged accidentally (the CI robot not respecting a hold). Hence, the feedback to that PR is merged separately. Signed-off-by: Rostislav M. Georgiev <[email protected]>
1 parent 5dc87d2 commit ec4840f

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

cmd/kubeadm/app/apis/kubeadm/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ type ClusterConfiguration struct {
114114
CIImageRepository string
115115

116116
// UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images
117+
// DEPRECATED: As hyperkube is itself deprecated, this fields is too. It will be removed in future kubeadm config versions, kubeadm
118+
// will print multiple warnings when set to true, and at some point it may become ignored.
117119
UseHyperKubeImage bool
118120

119121
// FeatureGates enabled by the user.

cmd/kubeadm/app/apis/kubeadm/v1beta1/types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
"k8s.io/api/core/v1"
20+
v1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

@@ -106,6 +106,8 @@ type ClusterConfiguration struct {
106106
ImageRepository string `json:"imageRepository"`
107107

108108
// UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images
109+
// DEPRECATED: As hyperkube is itself deprecated, this fields is too. It will be removed in future kubeadm config versions, kubeadm
110+
// will print multiple warnings when set to true, and at some point it may become ignored.
109111
UseHyperKubeImage bool `json:"useHyperKubeImage,omitempty"`
110112

111113
// FeatureGates enabled by the user.

cmd/kubeadm/app/apis/kubeadm/v1beta2/types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1beta2
1818

1919
import (
20-
"k8s.io/api/core/v1"
20+
v1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

@@ -102,6 +102,8 @@ type ClusterConfiguration struct {
102102
ImageRepository string `json:"imageRepository,omitempty"`
103103

104104
// UseHyperKubeImage controls if hyperkube should be used for Kubernetes components instead of their respective separate images
105+
// DEPRECATED: As hyperkube is itself deprecated, this fields is too. It will be removed in future kubeadm config versions, kubeadm
106+
// will print multiple warnings when set to true, and at some point it may become ignored.
105107
UseHyperKubeImage bool `json:"useHyperKubeImage,omitempty"`
106108

107109
// FeatureGates enabled by the user.

cmd/kubeadm/app/images/images.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import (
2525
kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util"
2626
)
2727

28+
const extraHyperKubeNote = ` The "useHyperKubeImage" field will be removed from future kubeadm config versions and possibly ignored in future releases.`
29+
2830
// GetGenericImage generates and returns a platform agnostic image (backed by manifest list)
2931
func GetGenericImage(prefix, image, tag string) string {
3032
return fmt.Sprintf("%s/%s:%s", prefix, image, tag)
@@ -34,7 +36,7 @@ func GetGenericImage(prefix, image, tag string) string {
3436
// including the control-plane components and kube-proxy. If specified, the HyperKube image will be used.
3537
func GetKubernetesImage(image string, cfg *kubeadmapi.ClusterConfiguration) string {
3638
if cfg.UseHyperKubeImage && image != constants.HyperKube {
37-
klog.Warningf(`WARNING: DEPRECATED use of the "hyperkube" image in place of %q`, image)
39+
klog.Warningf(`WARNING: DEPRECATED use of the "hyperkube" image in place of %q.`+extraHyperKubeNote, image)
3840
image = constants.HyperKube
3941
}
4042
repoPrefix := cfg.GetControlPlaneImageRepository()
@@ -93,7 +95,7 @@ func GetControlPlaneImages(cfg *kubeadmapi.ClusterConfiguration) []string {
9395

9496
// start with core kubernetes images
9597
if cfg.UseHyperKubeImage {
96-
klog.Warningln(`WARNING: DEPRECATED use of the "hyperkube" image for the Kubernetes control plane`)
98+
klog.Warningln(`WARNING: DEPRECATED use of the "hyperkube" image for the Kubernetes control plane.` + extraHyperKubeNote)
9799
imgs = append(imgs, GetKubernetesImage(constants.HyperKube, cfg))
98100
} else {
99101
imgs = append(imgs, GetKubernetesImage(constants.KubeAPIServer, cfg))

0 commit comments

Comments
 (0)