if driver disable support of FSGroup, mounter will not process the volume ownership

This commit is contained in:
Florent BENOIT 2018-09-14 10:39:30 +02:00
parent a8e8e891f2
commit 6584df5914
2 changed files with 5 additions and 1 deletions

View File

@ -223,6 +223,7 @@ type DriverCapabilities struct {
Attach bool `json:"attach"` Attach bool `json:"attach"`
SELinuxRelabel bool `json:"selinuxRelabel"` SELinuxRelabel bool `json:"selinuxRelabel"`
SupportsMetrics bool `json:"supportsMetrics"` SupportsMetrics bool `json:"supportsMetrics"`
FSGroup bool `json:"fsGroup"`
} }
func defaultCapabilities() *DriverCapabilities { func defaultCapabilities() *DriverCapabilities {
@ -230,6 +231,7 @@ func defaultCapabilities() *DriverCapabilities {
Attach: true, Attach: true,
SELinuxRelabel: true, SELinuxRelabel: true,
SupportsMetrics: false, SupportsMetrics: false,
FSGroup: true,
} }
} }

View File

@ -92,7 +92,9 @@ func (f *flexVolumeMounter) SetUpAt(dir string, fsGroup *int64) error {
} }
if !f.readOnly { if !f.readOnly {
volume.SetVolumeOwnership(f, fsGroup) if f.plugin.capabilities.FSGroup {
volume.SetVolumeOwnership(f, fsGroup)
}
} }
return nil return nil