Skip to content

Commit

Permalink
if driver disable support of FSGroup, mounter will not process the vo…
Browse files Browse the repository at this point in the history
…lume ownership
  • Loading branch information
benoitf committed Sep 25, 2018
1 parent a8e8e89 commit 6584df5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/volume/flexvolume/driver-call.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ type DriverCapabilities struct {
Attach bool `json:"attach"`
SELinuxRelabel bool `json:"selinuxRelabel"`
SupportsMetrics bool `json:"supportsMetrics"`
FSGroup bool `json:"fsGroup"`
}

func defaultCapabilities() *DriverCapabilities {
return &DriverCapabilities{
Attach: true,
SELinuxRelabel: true,
SupportsMetrics: false,
FSGroup: true,
}
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/volume/flexvolume/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6584df5

Please sign in to comment.