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
c7326813
Commit
c7326813
authored
Mar 14, 2016
by
Jeff Lowdermilk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test kubectl run with default args
Also explicitly pass generator for run deployments test.
parent
c0d3a0ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
4 deletions
+43
-4
kubectl.go
test/e2e/kubectl.go
+43
-4
No files found.
test/e2e/kubectl.go
View file @
c7326813
...
@@ -861,6 +861,48 @@ var _ = Describe("Kubectl client", func() {
...
@@ -861,6 +861,48 @@ var _ = Describe("Kubectl client", func() {
})
})
})
})
Describe
(
"Kubectl run default"
,
func
()
{
var
nsFlag
string
var
name
string
var
cleanUp
func
()
BeforeEach
(
func
()
{
nsFlag
=
fmt
.
Sprintf
(
"--namespace=%v"
,
ns
)
gte
,
err
:=
serverVersionGTE
(
deploymentsVersion
,
c
)
if
err
!=
nil
{
Failf
(
"Failed to get server version: %v"
,
err
)
}
if
gte
{
name
=
"e2e-test-nginx-deployment"
cleanUp
=
func
()
{
runKubectlOrDie
(
"delete"
,
"deployment"
,
name
,
nsFlag
)
}
}
else
{
name
=
"e2e-test-nginx-rc"
cleanUp
=
func
()
{
runKubectlOrDie
(
"delete"
,
"rc"
,
name
,
nsFlag
)
}
}
})
AfterEach
(
func
()
{
cleanUp
()
})
It
(
"should create an rc or deployment from an image [Conformance]"
,
func
()
{
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
name
,
"--image="
+
nginxImage
,
nsFlag
)
By
(
"verifying the pod controlled by "
+
name
+
" gets created"
)
label
:=
labels
.
SelectorFromSet
(
labels
.
Set
(
map
[
string
]
string
{
"run"
:
name
}))
podlist
,
err
:=
waitForPodsWithLabel
(
c
,
ns
,
label
)
if
err
!=
nil
{
Failf
(
"Failed getting pod controlled by %s: %v"
,
name
,
err
)
}
pods
:=
podlist
.
Items
if
pods
==
nil
||
len
(
pods
)
!=
1
||
len
(
pods
[
0
]
.
Spec
.
Containers
)
!=
1
||
pods
[
0
]
.
Spec
.
Containers
[
0
]
.
Image
!=
nginxImage
{
runKubectlOrDie
(
"get"
,
"pods"
,
"-L"
,
"run"
,
nsFlag
)
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
nginxImage
,
len
(
pods
))
}
})
})
Describe
(
"Kubectl run rc"
,
func
()
{
Describe
(
"Kubectl run rc"
,
func
()
{
var
nsFlag
string
var
nsFlag
string
var
rcName
string
var
rcName
string
...
@@ -913,7 +955,6 @@ var _ = Describe("Kubectl client", func() {
...
@@ -913,7 +955,6 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Failed getting logs by rc %s: %v"
,
rcName
,
err
)
Failf
(
"Failed getting logs by rc %s: %v"
,
rcName
,
err
)
}
}
})
})
})
})
Describe
(
"Kubectl run deployment"
,
func
()
{
Describe
(
"Kubectl run deployment"
,
func
()
{
...
@@ -933,7 +974,7 @@ var _ = Describe("Kubectl client", func() {
...
@@ -933,7 +974,7 @@ var _ = Describe("Kubectl client", func() {
SkipUnlessServerVersionGTE
(
deploymentsVersion
,
c
)
SkipUnlessServerVersionGTE
(
deploymentsVersion
,
c
)
By
(
"running the image "
+
nginxImage
)
By
(
"running the image "
+
nginxImage
)
runKubectlOrDie
(
"run"
,
dName
,
"--image="
+
nginxImage
,
nsFlag
)
runKubectlOrDie
(
"run"
,
dName
,
"--image="
+
nginxImage
,
"--generator=deployment/v1beta1"
,
nsFlag
)
By
(
"verifying the deployment "
+
dName
+
" was created"
)
By
(
"verifying the deployment "
+
dName
+
" was created"
)
d
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Get
(
dName
)
d
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Get
(
dName
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -956,7 +997,6 @@ var _ = Describe("Kubectl client", func() {
...
@@ -956,7 +997,6 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
nginxImage
,
len
(
pods
))
Failf
(
"Failed creating 1 pod with expected image %s. Number of pods = %v"
,
nginxImage
,
len
(
pods
))
}
}
})
})
})
})
Describe
(
"Kubectl run job"
,
func
()
{
Describe
(
"Kubectl run job"
,
func
()
{
...
@@ -1009,7 +1049,6 @@ var _ = Describe("Kubectl client", func() {
...
@@ -1009,7 +1049,6 @@ var _ = Describe("Kubectl client", func() {
Failf
(
"Failed creating a job with correct restart policy for --restart=OnFailure"
)
Failf
(
"Failed creating a job with correct restart policy for --restart=OnFailure"
)
}
}
})
})
})
})
Describe
(
"Kubectl run --rm job"
,
func
()
{
Describe
(
"Kubectl run --rm job"
,
func
()
{
...
...
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