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
ccaba2cc
Commit
ccaba2cc
authored
Nov 04, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Nov 04, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #36022 from janetkuo/statefulset-e2e-hostname
Automatic merge from submit-queue StatefulSet e2e: verify stateful pod hostname cc @erictune @foxish @kubernetes/sig-apps
parents
4280eed6
76ab3a45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
petset.go
test/e2e/petset.go
+18
-1
No files found.
test/e2e/petset.go
View file @
ccaba2cc
...
@@ -125,11 +125,14 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
...
@@ -125,11 +125,14 @@ var _ = framework.KubeDescribe("StatefulSet [Slow] [Feature:PetSet]", func() {
By
(
"Verifying statefulset mounted data directory is usable"
)
By
(
"Verifying statefulset mounted data directory is usable"
)
ExpectNoError
(
pst
.
checkMount
(
ps
,
"/data"
))
ExpectNoError
(
pst
.
checkMount
(
ps
,
"/data"
))
By
(
"Verifying statefulset provides a stable hostname for each pod"
)
ExpectNoError
(
pst
.
checkHostname
(
ps
))
cmd
:=
"echo $(hostname) > /data/hostname; sync;"
cmd
:=
"echo $(hostname) > /data/hostname; sync;"
By
(
"Running "
+
cmd
+
" in all pets"
)
By
(
"Running "
+
cmd
+
" in all pets"
)
ExpectNoError
(
pst
.
execInPets
(
ps
,
cmd
))
ExpectNoError
(
pst
.
execInPets
(
ps
,
cmd
))
By
(
"Restarting
pet
set "
+
ps
.
Name
)
By
(
"Restarting
stateful
set "
+
ps
.
Name
)
pst
.
restart
(
ps
)
pst
.
restart
(
ps
)
pst
.
saturate
(
ps
)
pst
.
saturate
(
ps
)
...
@@ -572,6 +575,20 @@ func (p *statefulSetTester) execInPets(ps *apps.StatefulSet, cmd string) error {
...
@@ -572,6 +575,20 @@ func (p *statefulSetTester) execInPets(ps *apps.StatefulSet, cmd string) error {
return
nil
return
nil
}
}
func
(
p
*
statefulSetTester
)
checkHostname
(
ps
*
apps
.
StatefulSet
)
error
{
cmd
:=
"printf $(hostname)"
podList
:=
p
.
getPodList
(
ps
)
for
_
,
pet
:=
range
podList
.
Items
{
hostname
,
err
:=
framework
.
RunHostCmd
(
pet
.
Namespace
,
pet
.
Name
,
cmd
)
if
err
!=
nil
{
return
err
}
if
hostname
!=
pet
.
Name
{
return
fmt
.
Errorf
(
"unexpected hostname (%s) and stateful pod name (%s) not equal"
,
hostname
,
pet
.
Name
)
}
}
return
nil
}
func
(
p
*
statefulSetTester
)
saturate
(
ps
*
apps
.
StatefulSet
)
{
func
(
p
*
statefulSetTester
)
saturate
(
ps
*
apps
.
StatefulSet
)
{
// TODO: Watch events and check that creation timestamps don't overlap
// TODO: Watch events and check that creation timestamps don't overlap
var
i
int32
var
i
int32
...
...
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