From 78fd97294dbc8bbf5ef1a490b2d7b7ad96fddcae Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Mon, 13 Jul 2020 17:01:42 +0200 Subject: [PATCH] Kubernetes volume & stamping fixes This reenables the projected and downwardapi volume types, both of which are necessary for the CTS to pass and are derivatives of the configmap volume which we already support. This also fixes an issue where the stamping definitions for Kubernetes were not present on our main Kubernetes binary, which broke the CTS. Test Plan: Volumes will be covered by CTS (writing our own tests would be duplicate work), version was manually tested to be correct in `bazel run //core/cmd/dbg -- kubectl get nodes` since stamping is hard to test for. X-Origin-Diff: phab/D584 GitOrigin-RevId: 403b6c845bc399fdd44ec3ba4ca26e2512a5bc98 --- core/cmd/kube/BUILD | 2 ++ third_party/go/patches/k8s-kubernetes-build.patch | 6 +++--- third_party/go/patches/k8s-kubernetes.patch | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/core/cmd/kube/BUILD b/core/cmd/kube/BUILD index b1a22fe5..34466fc4 100644 --- a/core/cmd/kube/BUILD +++ b/core/cmd/kube/BUILD @@ -1,4 +1,5 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@//third_party/go:kubernetes_version_def.bzl", "version_x_defs") go_library( name = "go_default_library", @@ -24,4 +25,5 @@ go_binary( embed = [":go_default_library"], pure = "on", visibility = ["//visibility:public"], + x_defs = version_x_defs(), ) diff --git a/third_party/go/patches/k8s-kubernetes-build.patch b/third_party/go/patches/k8s-kubernetes-build.patch index 797769a0..7debfda3 100644 --- a/third_party/go/patches/k8s-kubernetes-build.patch +++ b/third_party/go/patches/k8s-kubernetes-build.patch @@ -27,14 +27,14 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd "//pkg/credentialprovider/gcp:go_default_library", "//pkg/features:go_default_library", "//pkg/kubelet:go_default_library", -@@ -78,25 +76,11 @@ +@@ -78,25 +76,13 @@ "//pkg/util/oom:go_default_library", "//pkg/util/rlimit:go_default_library", "//pkg/volume:go_default_library", - "//pkg/volume/cephfs:go_default_library", "//pkg/volume/configmap:go_default_library", "//pkg/volume/csi:go_default_library", -- "//pkg/volume/downwardapi:go_default_library", + "//pkg/volume/downwardapi:go_default_library", "//pkg/volume/emptydir:go_default_library", - "//pkg/volume/fc:go_default_library", "//pkg/volume/flexvolume:go_default_library", @@ -46,7 +46,7 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd "//pkg/volume/local:go_default_library", - "//pkg/volume/nfs:go_default_library", - "//pkg/volume/portworx:go_default_library", -- "//pkg/volume/projected:go_default_library", + "//pkg/volume/projected:go_default_library", - "//pkg/volume/quobyte:go_default_library", - "//pkg/volume/rbd:go_default_library", - "//pkg/volume/scaleio:go_default_library", diff --git a/third_party/go/patches/k8s-kubernetes.patch b/third_party/go/patches/k8s-kubernetes.patch index 6d4663eb..27a1decd 100644 --- a/third_party/go/patches/k8s-kubernetes.patch +++ b/third_party/go/patches/k8s-kubernetes.patch @@ -244,14 +244,14 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd _ "k8s.io/kubernetes/pkg/credentialprovider/gcp" "k8s.io/component-base/featuregate" -@@ -28,27 +26,13 @@ +@@ -28,27 +26,15 @@ // Volume plugins "k8s.io/kubernetes/pkg/volume" - "k8s.io/kubernetes/pkg/volume/cephfs" "k8s.io/kubernetes/pkg/volume/configmap" "k8s.io/kubernetes/pkg/volume/csi" -- "k8s.io/kubernetes/pkg/volume/downwardapi" + "k8s.io/kubernetes/pkg/volume/downwardapi" "k8s.io/kubernetes/pkg/volume/emptydir" - "k8s.io/kubernetes/pkg/volume/fc" "k8s.io/kubernetes/pkg/volume/flexvolume" @@ -263,7 +263,7 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd "k8s.io/kubernetes/pkg/volume/local" - "k8s.io/kubernetes/pkg/volume/nfs" - "k8s.io/kubernetes/pkg/volume/portworx" -- "k8s.io/kubernetes/pkg/volume/projected" + "k8s.io/kubernetes/pkg/volume/projected" - "k8s.io/kubernetes/pkg/volume/quobyte" - "k8s.io/kubernetes/pkg/volume/rbd" - "k8s.io/kubernetes/pkg/volume/scaleio" @@ -272,7 +272,7 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd // Cloud providers _ "k8s.io/kubernetes/pkg/cloudprovider/providers" -@@ -64,30 +48,11 @@ +@@ -64,30 +48,13 @@ // // Kubelet does not currently need to configure volume plugins. // If/when it does, see kube-controller-manager/app/plugins.go for example of using volume.VolumeConfig @@ -291,11 +291,11 @@ diff -ur io_k8s_kubernetes.orig/cmd/kubelet/app/plugins.go io_k8s_kubernetes/cmd - allPlugins = append(allPlugins, rbd.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, quobyte.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, cephfs.ProbeVolumePlugins()...) -- allPlugins = append(allPlugins, downwardapi.ProbeVolumePlugins()...) + allPlugins = append(allPlugins, downwardapi.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, fc.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, flocker.ProbeVolumePlugins()...) allPlugins = append(allPlugins, configmap.ProbeVolumePlugins()...) -- allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...) + allPlugins = append(allPlugins, projected.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, portworx.ProbeVolumePlugins()...) - allPlugins = append(allPlugins, scaleio.ProbeVolumePlugins()...) allPlugins = append(allPlugins, local.ProbeVolumePlugins()...)