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
4e2f97a8
Commit
4e2f97a8
authored
Jun 13, 2016
by
Prashanth Balasubramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some logging around ro flag in GCE volume plugin
parent
90644d77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
attacher.go
pkg/volume/gce_pd/attacher.go
+1
-0
gce_pd.go
pkg/volume/gce_pd/gce_pd.go
+3
-2
petset.go
test/e2e/petset.go
+7
-6
No files found.
pkg/volume/gce_pd/attacher.go
View file @
4e2f97a8
...
...
@@ -166,6 +166,7 @@ func (attacher *gcePersistentDiskAttacher) MountDevice(spec *volume.Spec, device
os
.
Remove
(
deviceMountPath
)
return
err
}
glog
.
V
(
4
)
.
Infof
(
"formatting spec %v devicePath %v deviceMountPath %v fs %v with options %+v"
,
spec
.
Name
(),
devicePath
,
deviceMountPath
,
volumeSource
.
FSType
,
options
)
}
return
nil
}
...
...
pkg/volume/gce_pd/gce_pd.go
View file @
4e2f97a8
...
...
@@ -86,11 +86,12 @@ func getVolumeSource(spec *volume.Spec) (*api.GCEPersistentDiskVolumeSource, boo
if
spec
.
Volume
!=
nil
&&
spec
.
Volume
.
GCEPersistentDisk
!=
nil
{
volumeSource
=
spec
.
Volume
.
GCEPersistentDisk
readOnly
=
volumeSource
.
ReadOnly
glog
.
V
(
4
)
.
Infof
(
"volume source %v spec %v, readonly flag retrieved from source: %v"
,
volumeSource
.
PDName
,
spec
.
Name
(),
readOnly
)
}
else
{
volumeSource
=
spec
.
PersistentVolume
.
Spec
.
GCEPersistentDisk
readOnly
=
spec
.
ReadOnly
glog
.
V
(
4
)
.
Infof
(
"volume source %v spec %v, readonly flag retrieved from spec: %v"
,
volumeSource
.
PDName
,
spec
.
Name
(),
readOnly
)
}
return
volumeSource
,
readOnly
}
...
...
@@ -219,7 +220,7 @@ func (b *gcePersistentDiskMounter) SetUp(fsGroup *int64) error {
func
(
b
*
gcePersistentDiskMounter
)
SetUpAt
(
dir
string
,
fsGroup
*
int64
)
error
{
// TODO: handle failed mounts here.
notMnt
,
err
:=
b
.
mounter
.
IsLikelyNotMountPoint
(
dir
)
glog
.
V
(
4
)
.
Infof
(
"PersistentDisk set up: %s %v %v
"
,
dir
,
!
notMnt
,
err
)
glog
.
V
(
4
)
.
Infof
(
"PersistentDisk set up: %s %v %v
, pd name %v readOnly %v"
,
dir
,
!
notMnt
,
err
,
b
.
pdName
,
b
.
readOnly
)
if
err
!=
nil
&&
!
os
.
IsNotExist
(
err
)
{
return
err
}
...
...
test/e2e/petset.go
View file @
4e2f97a8
...
...
@@ -110,7 +110,7 @@ var _ = framework.KubeDescribe("PetSet [Slow] [Feature:PetSet]", func() {
pst
.
saturate
(
ps
)
By
(
"Verifying petset mounted data directory is usable"
)
ExpectNoError
(
pst
.
verifyDirectoryIsUsable
(
"/data"
))
ExpectNoError
(
pst
.
checkMount
(
ps
,
"/data"
))
cmd
:=
"echo $(hostname) > /data/hostname; sync;"
By
(
"Running "
+
cmd
+
" in all pets"
)
...
...
@@ -121,7 +121,7 @@ var _ = framework.KubeDescribe("PetSet [Slow] [Feature:PetSet]", func() {
pst
.
saturate
(
ps
)
By
(
"Verifying petset mounted data directory is usable"
)
ExpectNoError
(
pst
.
verifyDirectoryIsUsable
(
"/data"
))
ExpectNoError
(
pst
.
checkMount
(
ps
,
"/data"
))
cmd
=
"if [
\"
$(cat /data/hostname)
\"
=
\"
$(hostname)
\"
]; then exit 0; else exit 1; fi"
By
(
"Running "
+
cmd
+
" in all pets"
)
...
...
@@ -420,19 +420,20 @@ func (p *petSetTester) createPetSet(manifestPath, ns string) *apps.PetSet {
return
ps
}
func
(
p
*
petSetTester
)
verifyDirectoryIsUsable
(
dir
Path
string
)
error
{
func
(
p
*
petSetTester
)
checkMount
(
ps
*
apps
.
PetSet
,
mount
Path
string
)
error
{
for
_
,
cmd
:=
range
[]
string
{
// Print inode, size etc
fmt
.
Sprintf
(
"ls -idlh %v"
,
dir
Path
),
fmt
.
Sprintf
(
"ls -idlh %v"
,
mount
Path
),
// Print subdirs
fmt
.
Sprintf
(
"find %v"
,
dir
Path
),
fmt
.
Sprintf
(
"find %v"
,
mount
Path
),
// Try writing
fmt
.
Sprintf
(
"touch %v"
,
filepath
.
Join
(
dir
Path
,
fmt
.
Sprintf
(
"%v"
,
time
.
Now
()
.
UnixNano
()))),
fmt
.
Sprintf
(
"touch %v"
,
filepath
.
Join
(
mount
Path
,
fmt
.
Sprintf
(
"%v"
,
time
.
Now
()
.
UnixNano
()))),
}
{
if
err
:=
p
.
execInPets
(
ps
,
cmd
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to execute %v, error: %v"
,
cmd
,
err
)
}
}
return
nil
}
func
(
p
*
petSetTester
)
execInPets
(
ps
*
apps
.
PetSet
,
cmd
string
)
error
{
...
...
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