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
9a954248
Commit
9a954248
authored
Apr 11, 2018
by
Jan Safranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update e2e test with private mount propagation
parent
2c5eaea5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
mount_propagation.go
test/e2e/node/mount_propagation.go
+16
-5
No files found.
test/e2e/node/mount_propagation.go
View file @
9a954248
...
@@ -28,7 +28,7 @@ import (
...
@@ -28,7 +28,7 @@ import (
.
"github.com/onsi/gomega"
.
"github.com/onsi/gomega"
)
)
func
preparePod
(
name
string
,
node
*
v1
.
Node
,
propagation
v1
.
MountPropagationMode
,
hostDir
string
)
*
v1
.
Pod
{
func
preparePod
(
name
string
,
node
*
v1
.
Node
,
propagation
*
v1
.
MountPropagationMode
,
hostDir
string
)
*
v1
.
Pod
{
const
containerName
=
"cntr"
const
containerName
=
"cntr"
bTrue
:=
true
bTrue
:=
true
var
oneSecond
int64
=
1
var
oneSecond
int64
=
1
...
@@ -49,7 +49,7 @@ func preparePod(name string, node *v1.Node, propagation v1.MountPropagationMode,
...
@@ -49,7 +49,7 @@ func preparePod(name string, node *v1.Node, propagation v1.MountPropagationMode,
{
{
Name
:
"host"
,
Name
:
"host"
,
MountPath
:
"/mnt/test"
,
MountPath
:
"/mnt/test"
,
MountPropagation
:
&
propagation
,
MountPropagation
:
propagation
,
},
},
},
},
SecurityContext
:
&
v1
.
SecurityContext
{
SecurityContext
:
&
v1
.
SecurityContext
{
...
@@ -105,12 +105,19 @@ var _ = SIGDescribe("Mount propagation", func() {
...
@@ -105,12 +105,19 @@ var _ = SIGDescribe("Mount propagation", func() {
}()
}()
podClient
:=
f
.
PodClient
()
podClient
:=
f
.
PodClient
()
master
:=
podClient
.
CreateSync
(
preparePod
(
"master"
,
node
,
v1
.
MountPropagationBidirectional
,
hostDir
))
bidirectional
:=
v1
.
MountPropagationBidirectional
slave
:=
podClient
.
CreateSync
(
preparePod
(
"slave"
,
node
,
v1
.
MountPropagationHostToContainer
,
hostDir
))
master
:=
podClient
.
CreateSync
(
preparePod
(
"master"
,
node
,
&
bidirectional
,
hostDir
))
hostToContainer
:=
v1
.
MountPropagationHostToContainer
slave
:=
podClient
.
CreateSync
(
preparePod
(
"slave"
,
node
,
&
hostToContainer
,
hostDir
))
none
:=
v1
.
MountPropagationNone
private
:=
podClient
.
CreateSync
(
preparePod
(
"private"
,
node
,
&
none
,
hostDir
))
defaultPropagation
:=
podClient
.
CreateSync
(
preparePod
(
"default"
,
node
,
nil
,
hostDir
))
// Check that the pods sees directories of each other. This just checks
// Check that the pods sees directories of each other. This just checks
// that they have the same HostPath, not the mount propagation.
// that they have the same HostPath, not the mount propagation.
podNames
:=
[]
string
{
master
.
Name
,
slave
.
Name
}
podNames
:=
[]
string
{
master
.
Name
,
slave
.
Name
,
private
.
Name
,
defaultPropagation
.
Name
}
for
_
,
podName
:=
range
podNames
{
for
_
,
podName
:=
range
podNames
{
for
_
,
dirName
:=
range
podNames
{
for
_
,
dirName
:=
range
podNames
{
cmd
:=
fmt
.
Sprintf
(
"test -d /mnt/test/%s"
,
dirName
)
cmd
:=
fmt
.
Sprintf
(
"test -d /mnt/test/%s"
,
dirName
)
...
@@ -147,6 +154,10 @@ var _ = SIGDescribe("Mount propagation", func() {
...
@@ -147,6 +154,10 @@ var _ = SIGDescribe("Mount propagation", func() {
"master"
:
sets
.
NewString
(
"master"
,
"host"
),
"master"
:
sets
.
NewString
(
"master"
,
"host"
),
// Slave sees master's mount + itself.
// Slave sees master's mount + itself.
"slave"
:
sets
.
NewString
(
"master"
,
"slave"
,
"host"
),
"slave"
:
sets
.
NewString
(
"master"
,
"slave"
,
"host"
),
// Private sees only its own mount
"private"
:
sets
.
NewString
(
"private"
),
// Default (=private) sees only its own mount
"default"
:
sets
.
NewString
(
"default"
),
}
}
dirNames
:=
append
(
podNames
,
"host"
)
dirNames
:=
append
(
podNames
,
"host"
)
for
podName
,
mounts
:=
range
expectedMounts
{
for
podName
,
mounts
:=
range
expectedMounts
{
...
...
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