diff --git a/build/BUILD b/build/BUILD index 5d16b60421c..5f531a1f663 100644 --- a/build/BUILD +++ b/build/BUILD @@ -122,6 +122,7 @@ release_filegroup( release_filegroup( name = "server-targets", srcs = [ + "//cluster/gce/gci/mounter", "//cmd/cloud-controller-manager", "//cmd/hyperkube", "//cmd/kube-apiserver", diff --git a/build/lib/release.sh b/build/lib/release.sh index 7637bed98d2..85a1d784f56 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -412,7 +412,6 @@ function kube::release::package_kube_manifests_tarball() { cp "${salt_dir}/rescheduler/rescheduler.manifest" "${gci_dst_dir}/" cp "${salt_dir}/e2e-image-puller/e2e-image-puller.manifest" "${gci_dst_dir}/" cp "${KUBE_ROOT}/cluster/gce/gci/configure-helper.sh" "${gci_dst_dir}/gci-configure-helper.sh" - cp "${KUBE_ROOT}/cluster/gce/gci/mounter/mounter" "${gci_dst_dir}/gci-mounter" cp "${KUBE_ROOT}/cluster/gce/gci/health-monitor.sh" "${gci_dst_dir}/health-monitor.sh" cp "${KUBE_ROOT}/cluster/gce/container-linux/configure-helper.sh" "${gci_dst_dir}/container-linux-configure-helper.sh" cp -r "${salt_dir}/kube-admission-controls/limit-range" "${gci_dst_dir}" diff --git a/cluster/gce/gci/configure.sh b/cluster/gce/gci/configure.sh index 37803fc25ee..c8a7b117de9 100644 --- a/cluster/gce/gci/configure.sh +++ b/cluster/gce/gci/configure.sh @@ -141,7 +141,7 @@ function install-gci-mounter-tools { chmod a+x "${CONTAINERIZED_MOUNTER_HOME}" mkdir -p "${CONTAINERIZED_MOUNTER_HOME}/rootfs" download-or-bust "${mounter_tar_sha}" "https://storage.googleapis.com/kubernetes-release/gci-mounter/mounter.tar" - cp "${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/gci-mounter" "${CONTAINERIZED_MOUNTER_HOME}/mounter" + cp "${KUBE_HOME}/kubernetes/server/bin/mounter" "${CONTAINERIZED_MOUNTER_HOME}/mounter" chmod a+x "${CONTAINERIZED_MOUNTER_HOME}/mounter" mv "${KUBE_HOME}/mounter.tar" /tmp/mounter.tar tar xf /tmp/mounter.tar -C "${CONTAINERIZED_MOUNTER_HOME}/rootfs" diff --git a/cluster/gce/gci/mounter/.gitignore b/cluster/gce/gci/mounter/.gitignore new file mode 100644 index 00000000000..7742e145294 --- /dev/null +++ b/cluster/gce/gci/mounter/.gitignore @@ -0,0 +1 @@ +mounter diff --git a/cluster/gce/gci/mounter/mounter b/cluster/gce/gci/mounter/mounter deleted file mode 100755 index 963296e03d2..00000000000 Binary files a/cluster/gce/gci/mounter/mounter and /dev/null differ diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 55c3e144739..b9649ce6d0a 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -32,6 +32,7 @@ kube::golang::server_targets() { vendor/k8s.io/kube-aggregator vendor/k8s.io/apiextensions-apiserver plugin/cmd/kube-scheduler + cluster/gce/gci/mounter ) echo "${targets[@]}" } diff --git a/test/e2e_node/builder/build.go b/test/e2e_node/builder/build.go index f22232a3c5e..81f5b952d45 100644 --- a/test/e2e_node/builder/build.go +++ b/test/e2e_node/builder/build.go @@ -34,6 +34,7 @@ var buildTargets = []string{ "cmd/kubelet", "test/e2e_node/e2e_node.test", "vendor/github.com/onsi/ginkgo/ginkgo", + "cluster/gce/gci/mounter", } func BuildGo() error { diff --git a/test/e2e_node/remote/node_e2e.go b/test/e2e_node/remote/node_e2e.go index d22883afa2a..f95fc2b5802 100644 --- a/test/e2e_node/remote/node_e2e.go +++ b/test/e2e_node/remote/node_e2e.go @@ -30,8 +30,7 @@ import ( ) const ( - localCOSMounterPath = "cluster/gce/gci/mounter/mounter" - systemSpecPath = "test/e2e_node/system/specs" + systemSpecPath = "test/e2e_node/system/specs" ) // NodeE2ERemote contains the specific functions in the node e2e test suite. @@ -61,7 +60,7 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir, systemSpecName string) error { } // Copy binaries - requiredBins := []string{"kubelet", "e2e_node.test", "ginkgo"} + requiredBins := []string{"kubelet", "e2e_node.test", "ginkgo", "mounter"} for _, bin := range requiredBins { source := filepath.Join(buildOutputDir, bin) if _, err := os.Stat(source); err != nil { @@ -85,11 +84,6 @@ func (n *NodeE2ERemote) SetupTestPackage(tardir, systemSpecName string) error { } } - // Include the GCI/COS mounter artifacts in the deployed tarball - err = tarAddCOSMounter(tardir) - if err != nil { - return err - } return nil } @@ -110,51 +104,11 @@ func tarAddFile(tar, source, dest string) error { return nil } -// Includes the GCI/COS mounter artifacts in the deployed tarball -func tarAddCOSMounter(tar string) error { - k8sDir, err := builder.GetK8sRootDir() - if err != nil { - return fmt.Errorf("Could not find K8s root dir! Err: %v", err) - } - - source := filepath.Join(k8sDir, localCOSMounterPath) - - // Require the GCI/COS mounter script, we want to make sure the remote test runner stays up to date if the mounter file moves - if _, err := os.Stat(source); err != nil { - return fmt.Errorf("Could not find GCI/COS mounter script at %q! If this script has been (re)moved, please update the e2e node remote test runner accordingly! Err: %v", source, err) - } - - tarAddFile(tar, source, localCOSMounterPath) - return nil -} - // prependCOSMounterFlag prepends the flag for setting the GCI mounter path to // args and returns the result. func prependCOSMounterFlag(args, host, workspace string) (string, error) { - // If we are testing on a GCI/COS node, we chmod 544 the mounter and specify a different mounter path in the test args. - // We do this here because the local var `workspace` tells us which /tmp/node-e2e-%d is relevant to the current test run. - - // Determine if the GCI/COS mounter script exists locally. - k8sDir, err := builder.GetK8sRootDir() - if err != nil { - return args, fmt.Errorf("could not find K8s root dir! Err: %v", err) - } - source := filepath.Join(k8sDir, localCOSMounterPath) - - // Require the GCI/COS mounter script, we want to make sure the remote test runner stays up to date if the mounter file moves - if _, err = os.Stat(source); err != nil { - return args, fmt.Errorf("could not find GCI/COS mounter script at %q! If this script has been (re)moved, please update the e2e node remote test runner accordingly! Err: %v", source, err) - } - glog.V(2).Infof("GCI/COS node and GCI/COS mounter both detected, modifying --experimental-mounter-path accordingly") - // Note this implicitly requires the script to be where we expect in the tarball, so if that location changes the error - // here will tell us to update the remote test runner. - mounterPath := filepath.Join(workspace, localCOSMounterPath) - output, err := SSH(host, "sh", "-c", fmt.Sprintf("'chmod 544 %s'", mounterPath)) - if err != nil { - return args, fmt.Errorf("unabled to chmod 544 GCI/COS mounter script. Err: %v, Output:\n%s", err, output) - } - // Insert args at beginning of test args, so any values from command line take precedence + mounterPath := filepath.Join(workspace, "mounter") args = fmt.Sprintf("--kubelet-flags=--experimental-mounter-path=%s ", mounterPath) + args return args, nil }