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
0855f6a0
Commit
0855f6a0
authored
Aug 23, 2017
by
Matthew Wong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MountOptions field to PV spec
parent
b8fde17f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
types.go
pkg/api/types.go
+4
-0
util.go
pkg/volume/util.go
+5
-0
types.go
staging/src/k8s.io/api/core/v1/types.go
+5
-0
No files found.
pkg/api/types.go
View file @
0855f6a0
...
...
@@ -455,6 +455,10 @@ type PersistentVolumeSpec struct {
// means that this volume does not belong to any StorageClass.
// +optional
StorageClassName
string
// A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will
// simply fail if one is invalid.
// +optional
MountOptions
[]
string
}
// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes
...
...
pkg/volume/util.go
View file @
0855f6a0
...
...
@@ -389,12 +389,17 @@ func MountOptionFromSpec(spec *Spec, options ...string) []string {
pv
:=
spec
.
PersistentVolume
if
pv
!=
nil
{
// Use beta annotation first
if
mo
,
ok
:=
pv
.
Annotations
[
v1
.
MountOptionAnnotation
];
ok
{
moList
:=
strings
.
Split
(
mo
,
","
)
return
JoinMountOptions
(
moList
,
options
)
}
if
len
(
pv
.
Spec
.
MountOptions
)
>
0
{
return
JoinMountOptions
(
pv
.
Spec
.
MountOptions
,
options
)
}
}
return
options
}
...
...
staging/src/k8s.io/api/core/v1/types.go
View file @
0855f6a0
...
...
@@ -519,6 +519,11 @@ type PersistentVolumeSpec struct {
// means that this volume does not belong to any StorageClass.
// +optional
StorageClassName
string
`json:"storageClassName,omitempty" protobuf:"bytes,6,opt,name=storageClassName"`
// A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will
// simply fail if one is invalid.
// More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
// +optional
MountOptions
[]
string
`json:"mountOptions,omitempty" protobuf:"bytes,7,opt,name=mountOptions"`
}
// PersistentVolumeReclaimPolicy describes a policy for end-of-life maintenance of persistent volumes.
...
...
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