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
git: Use VolumeHost.GetExec() to execute stuff in volume plugins #51098
Conversation
/sig storage |
/retest |
pkg/volume/git_repo/git_repo_test.go
Outdated
var commandLog []expectedCommand | ||
execCallback := func(cmd string, args ...string) ([]byte, error) { | ||
// command is 'git -C <dir> <command> <args> | ||
gitCommand := args[2] |
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.
error out if len(args) is invalid
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.
good catch, fixed. Now I check that arg[0] == "-C"
, just to be sure.
pkg/volume/git_repo/git_repo_test.go
Outdated
} | ||
// add the command to log with de-randomized gitDir | ||
args[1] = strings.Replace(gitDir, mounter.GetPath(), "volume-dir", 1) |
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.
based on the context, it should just return volume-dir
right?
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.
Yes, it should always return "volume-dir". However, if there is bug in the volume plugin it may be called with a different directory and the test should catch it.
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.
why not just force it: args[1] = "volume-dir"
, replace doesn't reset the entire string
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.
Because I want to check that correct arg[1]
was used by the plugin. If the plugin uses /var/lib/kubelet/pods/<uid>/kubernetes.io~git/foo/123
instead of correct ..kubernetes.io~git/foo/
, Replace
will return volume-plugin/123
and the test (correctly) fails.
/retest |
/test all |
@rootfs not sure where we are with this, can it be merged? |
/approve no-issue |
/retest |
/retest Review the full test history for this PR. |
2 similar comments
/retest Review the full test history for this PR. |
/retest Review the full test history for this PR. |
/retest |
3 similar comments
/retest |
/retest |
/retest |
This prepares volume plugins to run things in containers instead of running them on the host.
Fixed e2e tests (luckily we have them): I forgot to fill Which led to panic when @rootfs PTAL |
/test pull-kubernetes-e2e-gce-etcd3 |
/test pull-kubernetes-e2e-gce-bazel |
Damn |
The best way out of this is to add And I do not know about any smart way how to run @rootfs, any idea? |
/keep-open |
/retest |
/test e2e-gce |
@rootfs, it seems that the test env. was updated and we can merge this PR. I added a release note to use newer git. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, rootfs Associated issue requirement bypassed by: rootfs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all |
/test kubernetes-cross |
/test pull-kubernetes-cross |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 60476, 62462, 61391, 62535, 62394). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Revert "git: Use VolumeHost.GetExec() to execute stuff in volume plugins" This reverts commit c578542 (PR #51098). The PR added support for containerized git, on the other hand it required git 1.8.5. This breaks git volumes on older distros (CentOS 7, Ubuntu 14.04) that have old git. Git volumes are getting deprecated (#60999) so we should restore it to the last working state and not touch it any longer. **Release note**: ```release-note gitRepo volumes in pods no longer require git 1.8.5 or newer, older git versions are supported too now. ``` I'd like to cherry-pick it into 1.10. /sig storage
This prepares volume plugins to run things in containers instead of running
them on the host.
Special notes for your reviewer:
cmd.SetDir(<dir>); cmd.Exec("git <command>")
, we docmd.Exec("git -C <dir> <command>")
- mounter.Exec does not have SetDir()@kubernetes/sig-storage-pr-reviews
/assign @rootfs