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
50467043
Commit
50467043
authored
Feb 03, 2015
by
Robert Rati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted test in pods suite to use native Go definition of the api.Pod #4070
parent
e9bf484f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
5 deletions
+29
-5
pods.go
test/e2e/pods.go
+29
-5
No files found.
test/e2e/pods.go
View file @
50467043
...
...
@@ -42,12 +42,36 @@ var _ = Describe("Pods", func() {
It
(
"should be submitted and removed"
,
func
()
{
podClient
:=
c
.
Pods
(
api
.
NamespaceDefault
)
By
(
"
loading the pod json
"
)
pod
:=
loadPodOrDie
(
assetPath
(
"api"
,
"examples"
,
"pod.json"
))
By
(
"
creating the pod
"
)
name
:=
"pod-update-"
+
string
(
util
.
NewUUID
(
))
value
:=
strconv
.
Itoa
(
time
.
Now
()
.
Nanosecond
())
pod
.
Name
=
pod
.
Name
+
"-"
+
randomSuffix
()
pod
.
Labels
[
"time"
]
=
value
pod
.
Spec
.
Containers
[
0
]
.
Ports
[
0
]
.
HostPort
=
0
pod
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
name
,
Labels
:
map
[
string
]
string
{
"name"
:
"foo"
,
"time"
:
value
,
},
},
Spec
:
api
.
PodSpec
{
Containers
:
[]
api
.
Container
{
{
Name
:
"nginx"
,
Image
:
"dockerfile/nginx"
,
Ports
:
[]
api
.
Port
{{
ContainerPort
:
80
}},
LivenessProbe
:
&
api
.
Probe
{
Handler
:
api
.
Handler
{
HTTPGet
:
&
api
.
HTTPGetAction
{
Path
:
"/index.html"
,
Port
:
util
.
NewIntOrStringFromInt
(
8080
),
},
},
InitialDelaySeconds
:
30
,
},
},
},
},
}
By
(
"submitting the pod to kubernetes"
)
_
,
err
:=
podClient
.
Create
(
pod
)
...
...
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