Add Kubernetes CTS
This adds patches and build specifications for the Kubernetes Conformance Test Suite. This involves
gating various cloud-specific tests behind the providerless flag (otherwise we'd gain a ton of additional dependencies)
and an additional 60MiB in test binary size.
Since the CTS for weird reasons requires kubectl to be available in the path we first build a kubectl go_image and then
stack the CTS on top of it. The output bundle is then preseeded for use.
Test Plan: `bazel run //core/tests/e2e/k8s_cts`
Bug: T836
X-Origin-Diff: phab/D615
GitOrigin-RevId: 7d2cd780a3ffb63b217591c5854b4aec4031d83d
diff --git a/third_party/go/patches/k8s-kubernetes.patch b/third_party/go/patches/k8s-kubernetes.patch
index 49250e5..8b766a6 100644
--- a/third_party/go/patches/k8s-kubernetes.patch
+++ b/third_party/go/patches/k8s-kubernetes.patch
@@ -348,3 +348,58 @@
_ "github.com/google/cadvisor/utils/cloudinfo/gce"
"github.com/google/cadvisor/cache/memory"
+
+--- io_k8s_kubernetes.orig/test/e2e/BUILD 2020-07-22 10:51:20.277358305 +0200
++++ io_k8s_kubernetes/test/e2e/BUILD 2020-07-22 10:56:43.451577495 +0200
+@@ -5,7 +5,7 @@
+ go_test = "go_test_conditional_pure",
+ )
+ load("@io_bazel_rules_go//go:def.bzl", "go_library")
+-load("//staging/src/k8s.io/component-base/version:def.bzl", "version_x_defs")
++load("@//third_party/go:kubernetes_version_def.bzl", "version_x_defs")
+
+ go_test(
+ name = "go_default_test",
+
+--- io_k8s_kubernetes.orig/test/e2e/generated/BUILD
++++ io_k8s_kubernetes/test/e2e/generated/BUILD
+@@ -4,23 +4,24 @@ load(
+ "@io_bazel_rules_go//go:def.bzl",
+ "go_library",
+ )
+-load("//build:bindata.bzl", "go_bindata")
++load("@nexantic//build/bindata:bindata.bzl", "bindata")
+
+ go_library(
+ name = "go_default_library",
+ srcs = [
+- "bindata.go",
+ "gobindata_util.go",
+ "main.go",
+ ],
++ embed = [
++ ":bindata",
++ ],
+ importpath = "k8s.io/kubernetes/test/e2e/generated",
+ deps = [
+ "@io_k8s_klog_v2//:go_default_library",
+ ],
+ )
+
+-# IMPORTANT: if you make any changes here, you must also update hack/generate-bindata.sh.
+-go_bindata(
++bindata(
+ name = "bindata",
+ srcs = [
+ "//test/conformance/testdata:all-srcs",
+@@ -29,9 +30,7 @@ go_bindata(
+ "//test/fixtures:all-srcs",
+ "//test/images:all-srcs",
+ ],
+- outs = ["bindata.go"],
+- compress = True,
+- include_metadata = False,
++ package = "generated",
+ )
+
+ filegroup(
\ No newline at end of file