Skip to content

Commit

Permalink
Kubernetes volume & stamping fixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Lorenz Brun committed Jul 13, 2020
1 parent cca74b6 commit 78fd972
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions core/cmd/kube/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -24,4 +25,5 @@ go_binary(
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
x_defs = version_x_defs(),
)
6 changes: 3 additions & 3 deletions third_party/go/patches/k8s-kubernetes-build.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
12 changes: 6 additions & 6 deletions third_party/go/patches/k8s-kubernetes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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()...)
Expand Down

0 comments on commit 78fd972

Please sign in to comment.