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
a66a60bc
Commit
a66a60bc
authored
Feb 24, 2016
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
e2e: change the tests to use versioned image nginx:1.7.9
parent
c0316978
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
30 deletions
+23
-30
kubectl.go
test/e2e/kubectl.go
+21
-28
pods.go
test/e2e/pods.go
+1
-1
pod-with-readiness-probe.yaml
...e/testing-manifests/kubectl/pod-with-readiness-probe.yaml
+1
-1
No files found.
test/e2e/kubectl.go
View file @
a66a60bc
...
...
@@ -72,6 +72,7 @@ const (
nginxDefaultOutput
=
"Welcome to nginx!"
simplePodPort
=
80
runJobTimeout
=
5
*
time
.
Minute
nginxImage
=
"gcr.io/google_containers/nginx:1.7.9"
)
var
(
...
...
@@ -874,18 +875,16 @@ var _ = Describe("Kubectl client", func() {
})
It
(
"should create an rc from an image [Conformance]"
,
func
()
{
image
:=
"nginx"
By
(
"running the image "
+
image
)
runKubectlOrDie
(
"run"
,
rcName
,
"--image="
+
image
,
"--generator=run/v1"
,
nsFlag
)
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
rcName
,
"--image="
+
nginxImage
,
"--generator=run/v1"
,
nsFlag
)
By
(
"verifying the rc "
+
rcName
+
" was created"
)
rc
,
err
:=
c
.
ReplicationControllers
(
ns
)
.
Get
(
rcName
)
if
err
!=
nil
{
Failf
(
"Failed getting rc %s: %v"
,
rcName
,
err
)
}
containers
:=
rc
.
Spec
.
Template
.
Spec
.
Containers
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
i
mage
{
Failf
(
"Failed creating rc %s for 1 pod with expected image %s"
,
rcName
,
i
mage
)
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxI
mage
{
Failf
(
"Failed creating rc %s for 1 pod with expected image %s"
,
rcName
,
nginxI
mage
)
}
By
(
"verifying the pod controlled by rc "
+
rcName
+
" was created"
)
...
...
@@ -895,9 +894,9 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Failed getting pod controlled by rc %s: %v"
,
rcName
,
err
)
}
pods
:=
podlist
.
Items
if
pods
==
nil
||
len
(
pods
)
!=
1
||
len
(
pods
[
0
]
.
Spec
.
Containers
)
!=
1
||
pods
[
0
]
.
Spec
.
Containers
[
0
]
.
Image
!=
i
mage
{
if
pods
==
nil
||
len
(
pods
)
!=
1
||
len
(
pods
[
0
]
.
Spec
.
Containers
)
!=
1
||
pods
[
0
]
.
Spec
.
Containers
[
0
]
.
Image
!=
nginxI
mage
{
runKubectlOrDie
(
"get"
,
"pods"
,
"-L"
,
"run"
,
nsFlag
)
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
i
mage
,
len
(
pods
))
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
nginxI
mage
,
len
(
pods
))
}
})
...
...
@@ -919,18 +918,16 @@ var _ = Describe("Kubectl client", func() {
It
(
"should create a deployment from an image [Conformance]"
,
func
()
{
SkipUnlessServerVersionGTE
(
deploymentsVersion
,
c
)
image
:=
"nginx"
By
(
"running the image "
+
image
)
runKubectlOrDie
(
"run"
,
dName
,
"--image="
+
image
,
nsFlag
)
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
dName
,
"--image="
+
nginxImage
,
nsFlag
)
By
(
"verifying the deployment "
+
dName
+
" was created"
)
d
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Get
(
dName
)
if
err
!=
nil
{
Failf
(
"Failed getting deployment %s: %v"
,
dName
,
err
)
}
containers
:=
d
.
Spec
.
Template
.
Spec
.
Containers
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
i
mage
{
Failf
(
"Failed creating deployment %s for 1 pod with expected image %s"
,
dName
,
i
mage
)
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxI
mage
{
Failf
(
"Failed creating deployment %s for 1 pod with expected image %s"
,
dName
,
nginxI
mage
)
}
By
(
"verifying the pod controlled by deployment "
+
dName
+
" was created"
)
...
...
@@ -940,9 +937,9 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Failed getting pod controlled by deployment %s: %v"
,
dName
,
err
)
}
pods
:=
podlist
.
Items
if
pods
==
nil
||
len
(
pods
)
!=
1
||
len
(
pods
[
0
]
.
Spec
.
Containers
)
!=
1
||
pods
[
0
]
.
Spec
.
Containers
[
0
]
.
Image
!=
i
mage
{
if
pods
==
nil
||
len
(
pods
)
!=
1
||
len
(
pods
[
0
]
.
Spec
.
Containers
)
!=
1
||
pods
[
0
]
.
Spec
.
Containers
[
0
]
.
Image
!=
nginxI
mage
{
runKubectlOrDie
(
"get"
,
"pods"
,
"-L"
,
"run"
,
nsFlag
)
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
i
mage
,
len
(
pods
))
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
nginxI
mage
,
len
(
pods
))
}
})
...
...
@@ -964,18 +961,16 @@ var _ = Describe("Kubectl client", func() {
It
(
"should create a job from an image when restart is OnFailure [Conformance]"
,
func
()
{
SkipUnlessServerVersionGTE
(
jobsVersion
,
c
)
image
:=
"nginx"
By
(
"running the image "
+
image
)
runKubectlOrDie
(
"run"
,
jobName
,
"--restart=OnFailure"
,
"--image="
+
image
,
nsFlag
)
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
jobName
,
"--restart=OnFailure"
,
"--image="
+
nginxImage
,
nsFlag
)
By
(
"verifying the job "
+
jobName
+
" was created"
)
job
,
err
:=
c
.
Extensions
()
.
Jobs
(
ns
)
.
Get
(
jobName
)
if
err
!=
nil
{
Failf
(
"Failed getting job %s: %v"
,
jobName
,
err
)
}
containers
:=
job
.
Spec
.
Template
.
Spec
.
Containers
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
i
mage
{
Failf
(
"Failed creating job %s for 1 pod with expected image %s"
,
jobName
,
i
mage
)
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxI
mage
{
Failf
(
"Failed creating job %s for 1 pod with expected image %s"
,
jobName
,
nginxI
mage
)
}
if
job
.
Spec
.
Template
.
Spec
.
RestartPolicy
!=
api
.
RestartPolicyOnFailure
{
Failf
(
"Failed creating a job with correct restart policy for --restart=OnFailure"
)
...
...
@@ -985,18 +980,16 @@ var _ = Describe("Kubectl client", func() {
It
(
"should create a job from an image when restart is Never [Conformance]"
,
func
()
{
SkipUnlessServerVersionGTE
(
jobsVersion
,
c
)
image
:=
"nginx"
By
(
"running the image "
+
image
)
runKubectlOrDie
(
"run"
,
jobName
,
"--restart=Never"
,
"--image="
+
image
,
nsFlag
)
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
jobName
,
"--restart=Never"
,
"--image="
+
nginxImage
,
nsFlag
)
By
(
"verifying the job "
+
jobName
+
" was created"
)
job
,
err
:=
c
.
Extensions
()
.
Jobs
(
ns
)
.
Get
(
jobName
)
if
err
!=
nil
{
Failf
(
"Failed getting job %s: %v"
,
jobName
,
err
)
}
containers
:=
job
.
Spec
.
Template
.
Spec
.
Containers
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
i
mage
{
Failf
(
"Failed creating job %s for 1 pod with expected image %s"
,
jobName
,
i
mage
)
if
containers
==
nil
||
len
(
containers
)
!=
1
||
containers
[
0
]
.
Image
!=
nginxI
mage
{
Failf
(
"Failed creating job %s for 1 pod with expected image %s"
,
jobName
,
nginxI
mage
)
}
if
job
.
Spec
.
Template
.
Spec
.
RestartPolicy
!=
api
.
RestartPolicyNever
{
Failf
(
"Failed creating a job with correct restart policy for --restart=OnFailure"
)
...
...
test/e2e/pods.go
View file @
a66a60bc
...
...
@@ -963,7 +963,7 @@ var _ = Describe("Pods", func() {
if
err
!=
nil
{
Failf
(
"failed to get pod: %v"
,
err
)
}
pod
.
Spec
.
Containers
[
0
]
.
Image
=
"
nginx
"
pod
.
Spec
.
Containers
[
0
]
.
Image
=
"
gcr.io/google_containers/nginx:1.7.9
"
pod
,
err
=
podClient
.
Update
(
pod
)
if
err
!=
nil
{
Failf
(
"error updating pod=%s/%s %v"
,
podName
,
containerName
,
err
)
...
...
test/e2e/testing-manifests/kubectl/pod-with-readiness-probe.yaml
View file @
a66a60bc
...
...
@@ -7,7 +7,7 @@ metadata:
spec
:
containers
:
-
name
:
nginx
image
:
nginx
image
:
gcr.io/google_containers/nginx:1.7.9
ports
:
-
containerPort
:
80
readinessProbe
:
...
...
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