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
0a6561f5
Commit
0a6561f5
authored
Jul 11, 2016
by
k8s-merge-robot
Committed by
GitHub
Jul 11, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #28704 from dims/fix-issue-11747
Automatic merge from submit-queue E2E test for kubectl replace
parents
6462f822
87771957
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
kubectl.go
test/e2e/kubectl.go
+48
-0
No files found.
test/e2e/kubectl.go
View file @
0a6561f5
...
@@ -1040,6 +1040,54 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
...
@@ -1040,6 +1040,54 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
})
})
})
})
framework
.
KubeDescribe
(
"Kubectl replace"
,
func
()
{
var
nsFlag
string
var
podName
string
BeforeEach
(
func
()
{
nsFlag
=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
podName
=
"e2e-test-nginx-pod"
})
AfterEach
(
func
()
{
framework
.
RunKubectlOrDie
(
"delete"
,
"pods"
,
podName
,
nsFlag
)
})
It
(
"should update a single-container pod's image [Conformance]"
,
func
()
{
framework
.
SkipUnlessServerVersionGTE
(
jobsVersion
,
c
)
By
(
"running the image "
+
nginxImage
)
framework
.
RunKubectlOrDie
(
"run"
,
podName
,
"--generator=run-pod/v1"
,
"--image="
+
nginxImage
,
"--labels=run="
+
podName
,
nsFlag
)
By
(
"verifying the pod "
+
podName
+
" is running"
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"run"
:
podName
}))
err
:=
framework
.
WaitForPodsWithLabelRunning
(
c
,
ns
,
label
)
if
err
!=
nil
{
framework
.
Failf
(
"Failed getting pod %s: %v"
,
podName
,
err
)
}
By
(
"verifying the pod "
+
podName
+
" was created"
)
podJson
:=
framework
.
RunKubectlOrDie
(
"get"
,
"pod"
,
podName
,
nsFlag
,
"-o"
,
"json"
)
if
!
strings
.
Contains
(
podJson
,
podName
)
{
framework
.
Failf
(
"Failed to find pod %s in [%s]"
,
podName
,
podJson
)
}
By
(
"replace the image in the pod"
)
podJson
=
strings
.
Replace
(
podJson
,
nginxImage
,
busyboxImage
,
1
)
framework
.
RunKubectlOrDieInput
(
podJson
,
"replace"
,
"-f"
,
"-"
,
nsFlag
)
By
(
"verifying the pod "
+
podName
+
" has the right image "
+
busyboxImage
)
pod
,
err
:=
c
.
Pods
(
ns
)
.
Get
(
podName
)
if
err
!=
nil
{
framework
.
Failf
(
"Failed getting deployment %s: %v"
,
podName
,
err
)
}
containers
:=
pod
.
Spec
.
Containers
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
busyboxImage
{
framework
.
Failf
(
"Failed creating pod with expected image %s"
,
busyboxImage
)
}
})
})
framework
.
KubeDescribe
(
"Kubectl run --rm job"
,
func
()
{
framework
.
KubeDescribe
(
"Kubectl run --rm job"
,
func
()
{
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
nsFlag
:=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
jobName
:=
"e2e-test-rm-busybox-job"
jobName
:=
"e2e-test-rm-busybox-job"
...
...
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