Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't check in mounter binary #47497

Merged
merged 1 commit into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions build/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ release_filegroup(
release_filegroup(
name = "server-targets",
srcs = [
"//cluster/gce/gci/mounter",
"//cmd/cloud-controller-manager",
"//cmd/hyperkube",
"//cmd/kube-apiserver",
Expand Down
1 change: 0 additions & 1 deletion build/lib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/gci/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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"
Expand Down
1 change: 1 addition & 0 deletions cluster/gce/gci/mounter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mounter
Binary file removed cluster/gce/gci/mounter/mounter
Binary file not shown.
1 change: 1 addition & 0 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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[@]}"
}
Expand Down
1 change: 1 addition & 0 deletions test/e2e_node/builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var buildTargets = []string{
"cmd/kubelet",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes me sad that these are not just bazel dependencies.

"test/e2e_node/e2e_node.test",
"vendor/github.com/onsi/ginkgo/ginkgo",
"cluster/gce/gci/mounter",
}

func BuildGo() error {
Expand Down
52 changes: 3 additions & 49 deletions test/e2e_node/remote/node_e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -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
}

Expand All @@ -110,51 +104,11 @@ func tarAddFile(tar, source, dest string) error {
return nil
}

// Includes the GCI/COS mounter artifacts in the deployed tarball
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so much less code. yes!

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
}
Expand Down