-
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
Update subpath e2e test for windows #77220
Conversation
@jingxu97: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/release-note-none
/kind cleanup
/priority important-longterm
/sig windows
@jingxu97 rebase? :-) |
4e590f1
to
47ddfdb
Compare
47ddfdb
to
b402749
Compare
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.
just some nits :)
@@ -901,5 +905,9 @@ func formatVolume(f *framework.Framework, pod *v1.Pod) { | |||
} | |||
|
|||
func podContainerExec(pod *v1.Pod, containerIndex int, bashExec string) (string, error) { |
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.
nit: variable should be scriptCmd
or something instead of bashExec
now
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.
fixed
if framework.NodeOSDistroIs("windows") { | ||
return framework.RunKubectl("exec", fmt.Sprintf("--namespace=%s", pod.Namespace), pod.Name, "--container", pod.Spec.Containers[containerIndex].Name, "--", "powershell", "/c", bashExec) | ||
} else { | ||
return framework.RunKubectl("exec", fmt.Sprintf("--namespace=%s", pod.Namespace), pod.Name, "--container", pod.Spec.Containers[containerIndex].Name, "--", "/bin/sh", "-c", bashExec) |
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.
nit: use a variable for powershell
bash
toggle, the rest of the command seems the same
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.
fixed
@@ -421,7 +434,7 @@ func (s *subPathTestSuite) defineTests(driver TestDriver, pattern testpatterns.T | |||
gomega.Expect(err).ToNot(gomega.HaveOccurred(), "while waiting for pod to be running") | |||
|
|||
// Exec into container that mounted the volume, delete subpath directory | |||
rmCmd := fmt.Sprintf("rm -rf %s", l.subPathDir) | |||
rmCmd := fmt.Sprintf("rm -r %s", l.subPathDir) |
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 did we remove -f? I think this swill now fail if subpath dir is for some reason non-existent. If that is desired behavior please add comment so future ppl dont un-fix this
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.
I removed it because windows does not has -f option. From the test workflow, subPathDir should not be empty. Do we need -f option in this case?
setInitCommand(l.pod, fmt.Sprintf("ln -s ../ %s", l.subPathDir)) | ||
|
||
if framework.NodeOSDistroIs("windows") { | ||
setInitCommand(l.pod, fmt.Sprintf("New-Item -ItemType SymbolicLink -Path %s -value ..\\", l.subPathDir)) |
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.
general nits: use a variable for the part that changes, avoid copying over function call and rest of arguments
@@ -282,17 +291,21 @@ func (s *subPathTestSuite) defineTests(driver TestDriver, pattern testpatterns.T | |||
testMultipleReads(f, l.pod, 0, filepath1, filepath2) | |||
}) | |||
|
|||
ginkgo.It("should support restarting containers using directory as subpath [Slow]", func() { | |||
ginkgo.It("should support restarting containers using directory as subpath [Slow][LinuxOnly]", func() { |
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.
this test is linux only, but we still have windows specific logic inside 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.
fixed
02b45a9
to
4d93956
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jingxu97, msau42 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest Review the full test history for this PR. Silence the bot with an |
4 similar comments
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
/retest Review the full test history for this PR. Silence the bot with an |
Modify the current subpath e2e file to allow it run in windows clusters. Change-Id: I921dfbbae9480c718853a97a76cc0a95b1af9790
4d93956
to
e570d27
Compare
/test pull-kubernetes-e2e-gce-100-performance |
/lgtm |
Modify the current subpath e2e file to allow it run in windows clusters.