Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
6b288273
Unverified
Commit
6b288273
authored
Mar 02, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Mar 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74805 from HotelsDotCom/feature/remove-kubectl-binary
VolumeSubpathEnvExpansion alpha tests - change kubectl references to API calls
parents
cfe4ca80
8828ccfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
expansion.go
test/e2e/common/expansion.go
+8
-8
No files found.
test/e2e/common/expansion.go
View file @
6b288273
...
@@ -478,14 +478,14 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
...
@@ -478,14 +478,14 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
By
(
"creating a file in subpath"
)
By
(
"creating a file in subpath"
)
cmd
:=
"touch /volume_mount/mypath/foo/test.log"
cmd
:=
"touch /volume_mount/mypath/foo/test.log"
_
,
err
=
framework
.
RunHostCmd
(
pod
.
Namespace
,
pod
.
Name
,
cmd
)
_
,
_
,
err
=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
framework
.
Failf
(
"expected to be able to write to subpath"
)
framework
.
Failf
(
"expected to be able to write to subpath"
)
}
}
By
(
"test for file in mounted path"
)
By
(
"test for file in mounted path"
)
cmd
=
"test -f /subpath_mount/test.log"
cmd
=
"test -f /subpath_mount/test.log"
_
,
err
=
framework
.
RunHostCmd
(
pod
.
Namespace
,
pod
.
Name
,
cmd
)
_
,
_
,
err
=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
framework
.
Failf
(
"expected to be able to verify file"
)
framework
.
Failf
(
"expected to be able to verify file"
)
}
}
...
@@ -625,13 +625,13 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
...
@@ -625,13 +625,13 @@ var _ = framework.KubeDescribe("Variable Expansion", func() {
By
(
"test for subpath mounted with old value"
)
By
(
"test for subpath mounted with old value"
)
cmd
:=
"test -f /volume_mount/foo/test.log"
cmd
:=
"test -f /volume_mount/foo/test.log"
_
,
err
=
framework
.
RunHostCmd
(
pod
.
Namespace
,
pod
.
Name
,
cmd
)
_
,
_
,
err
=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
framework
.
Failf
(
"expected to be able to verify old file exists"
)
framework
.
Failf
(
"expected to be able to verify old file exists"
)
}
}
cmd
=
"test ! -f /volume_mount/newsubpath/test.log"
cmd
=
"test ! -f /volume_mount/newsubpath/test.log"
_
,
err
=
framework
.
RunHostCmd
(
pod
.
Namespace
,
pod
.
Name
,
cmd
)
_
,
_
,
err
=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
cmd
)
if
err
!=
nil
{
if
err
!=
nil
{
framework
.
Failf
(
"expected to be able to verify new file does not exist"
)
framework
.
Failf
(
"expected to be able to verify new file does not exist"
)
}
}
...
@@ -656,9 +656,9 @@ func testPodFailSubpath(f *framework.Framework, pod *v1.Pod) {
...
@@ -656,9 +656,9 @@ func testPodFailSubpath(f *framework.Framework, pod *v1.Pod) {
func
waitForPodContainerRestart
(
f
*
framework
.
Framework
,
pod
*
v1
.
Pod
,
volumeMount
string
)
{
func
waitForPodContainerRestart
(
f
*
framework
.
Framework
,
pod
*
v1
.
Pod
,
volumeMount
string
)
{
By
(
"Failing liveness probe"
)
By
(
"Failing liveness probe"
)
out
,
err
:=
framework
.
RunKubectl
(
"exec"
,
fmt
.
Sprintf
(
"--namespace=%s"
,
pod
.
Namespace
),
pod
.
Name
,
"--container"
,
pod
.
Spec
.
Containers
[
0
]
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
fmt
.
Sprintf
(
"rm %v"
,
volumeMount
))
stdout
,
stderr
,
err
:=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
fmt
.
Sprintf
(
"rm %v"
,
volumeMount
))
framework
.
Logf
(
"Pod exec output: %v
"
,
out
)
framework
.
Logf
(
"Pod exec output: %v
/ %v"
,
stdout
,
stderr
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while failing liveness probe"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while failing liveness probe"
)
// Check that container has restarted
// Check that container has restarted
...
@@ -685,8 +685,8 @@ func waitForPodContainerRestart(f *framework.Framework, pod *v1.Pod, volumeMount
...
@@ -685,8 +685,8 @@ func waitForPodContainerRestart(f *framework.Framework, pod *v1.Pod, volumeMount
// Fix liveness probe
// Fix liveness probe
By
(
"Rewriting the file"
)
By
(
"Rewriting the file"
)
out
,
err
=
framework
.
RunKubectl
(
"exec"
,
fmt
.
Sprintf
(
"--namespace=%s"
,
pod
.
Namespace
),
pod
.
Name
,
"--container"
,
pod
.
Spec
.
Containers
[
0
]
.
Name
,
"--"
,
"/bin/sh"
,
"-c"
,
fmt
.
Sprintf
(
"echo test-after > %v"
,
volumeMount
))
stdout
,
_
,
err
=
f
.
ExecShellInPodWithFullOutput
(
pod
.
Name
,
fmt
.
Sprintf
(
"echo test-after > %v"
,
volumeMount
))
framework
.
Logf
(
"Pod exec output: %v"
,
out
)
framework
.
Logf
(
"Pod exec output: %v"
,
std
out
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while rewriting the probe file"
)
Expect
(
err
)
.
ToNot
(
HaveOccurred
(),
"while rewriting the probe file"
)
// Wait for container restarts to stabilize
// Wait for container restarts to stabilize
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment