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
ec1d83b8
Unverified
Commit
ec1d83b8
authored
Feb 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74335 from cofyc/fix74229
Use same fsGroup for both pods
parents
9b87046c
5c67d550
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
volume_util.go
test/e2e/framework/volume_util.go
+4
-3
volumes.go
test/e2e/storage/testsuites/volumes.go
+5
-1
No files found.
test/e2e/framework/volume_util.go
View file @
ec1d83b8
...
@@ -487,7 +487,7 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
...
@@ -487,7 +487,7 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro
// Insert index.html with given content into given volume. It does so by
// Insert index.html with given content into given volume. It does so by
// starting and auxiliary pod which writes the file there.
// starting and auxiliary pod which writes the file there.
// The volume must be writable.
// The volume must be writable.
func
InjectHtml
(
client
clientset
.
Interface
,
config
VolumeTestConfig
,
volume
v1
.
VolumeSource
,
content
string
)
{
func
InjectHtml
(
client
clientset
.
Interface
,
config
VolumeTestConfig
,
fsGroup
*
int64
,
volume
v1
.
VolumeSource
,
content
string
)
{
By
(
fmt
.
Sprint
(
"starting "
,
config
.
Prefix
,
" injector"
))
By
(
fmt
.
Sprint
(
"starting "
,
config
.
Prefix
,
" injector"
))
podClient
:=
client
.
CoreV1
()
.
Pods
(
config
.
Namespace
)
podClient
:=
client
.
CoreV1
()
.
Pods
(
config
.
Namespace
)
podName
:=
fmt
.
Sprintf
(
"%s-injector-%s"
,
config
.
Prefix
,
rand
.
String
(
4
))
podName
:=
fmt
.
Sprintf
(
"%s-injector-%s"
,
config
.
Prefix
,
rand
.
String
(
4
))
...
@@ -523,6 +523,9 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
...
@@ -523,6 +523,9 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
},
},
},
},
},
},
SecurityContext
:
&
v1
.
PodSecurityContext
{
FSGroup
:
fsGroup
,
},
RestartPolicy
:
v1
.
RestartPolicyNever
,
RestartPolicy
:
v1
.
RestartPolicyNever
,
Volumes
:
[]
v1
.
Volume
{
Volumes
:
[]
v1
.
Volume
{
{
{
...
@@ -537,8 +540,6 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
...
@@ -537,8 +540,6 @@ func InjectHtml(client clientset.Interface, config VolumeTestConfig, volume v1.V
defer
func
()
{
defer
func
()
{
podClient
.
Delete
(
podName
,
nil
)
podClient
.
Delete
(
podName
,
nil
)
err
:=
waitForPodNotFoundInNamespace
(
client
,
podName
,
injectPod
.
Namespace
,
PodDeleteTimeout
)
ExpectNoError
(
err
)
}()
}()
injectPod
,
err
:=
podClient
.
Create
(
injectPod
)
injectPod
,
err
:=
podClient
.
Create
(
injectPod
)
...
...
test/e2e/storage/testsuites/volumes.go
View file @
ec1d83b8
...
@@ -148,12 +148,16 @@ func (t *volumesTestSuite) defineTests(driver TestDriver, pattern testpatterns.T
...
@@ -148,12 +148,16 @@ func (t *volumesTestSuite) defineTests(driver TestDriver, pattern testpatterns.T
},
},
}
}
config
:=
convertTestConfig
(
l
.
config
)
config
:=
convertTestConfig
(
l
.
config
)
framework
.
InjectHtml
(
f
.
ClientSet
,
config
,
tests
[
0
]
.
Volume
,
tests
[
0
]
.
ExpectedContent
)
var
fsGroup
*
int64
var
fsGroup
*
int64
if
dInfo
.
Capabilities
[
CapFsGroup
]
{
if
dInfo
.
Capabilities
[
CapFsGroup
]
{
fsGroupVal
:=
int64
(
1234
)
fsGroupVal
:=
int64
(
1234
)
fsGroup
=
&
fsGroupVal
fsGroup
=
&
fsGroupVal
}
}
// We set same fsGroup for both pods, because for same volumes (e.g.
// local), plugin skips setting fsGroup if volume is already mounted
// and we don't have reliable way to detect volumes are unmounted or
// not before starting the second pod.
framework
.
InjectHtml
(
f
.
ClientSet
,
config
,
fsGroup
,
tests
[
0
]
.
Volume
,
tests
[
0
]
.
ExpectedContent
)
framework
.
TestVolumeClient
(
f
.
ClientSet
,
config
,
fsGroup
,
pattern
.
FsType
,
tests
)
framework
.
TestVolumeClient
(
f
.
ClientSet
,
config
,
fsGroup
,
pattern
.
FsType
,
tests
)
})
})
...
...
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