Merge pull request #68680 from benoitf/fix-chown

Fix chown on distributed flex volumes (like gluster)
pull/58/head
k8s-ci-robot 2018-09-25 19:23:58 -07:00 committed by GitHub
commit c8f0af2afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

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

View File

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