-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mounter |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.