Refactor volume.Builder.IsReadOnly() to volume.Builder.GetAttributes()

This commit is contained in:
Paul Morie
2015-10-30 16:25:36 -04:00
committed by Paul Morie
parent 961a02a602
commit 911757486d
34 changed files with 235 additions and 269 deletions

View File

@@ -109,8 +109,13 @@ type gitRepoVolumeBuilder struct {
var _ volume.Builder = &gitRepoVolumeBuilder{}
func (_ *gitRepoVolumeBuilder) SupportsOwnershipManagement() bool {
return true
func (b *gitRepoVolumeBuilder) GetAttributes() volume.Attributes {
return volume.Attributes{
ReadOnly: false,
Managed: true,
SupportsOwnershipManagement: false,
SupportsSELinux: true, // xattr change should be okay, TODO: double check
}
}
// SetUp creates new directory and clones a git repo.
@@ -118,14 +123,6 @@ func (b *gitRepoVolumeBuilder) SetUp() error {
return b.SetUpAt(b.GetPath())
}
func (b *gitRepoVolumeBuilder) IsReadOnly() bool {
return false
}
func (b *gitRepoVolumeBuilder) SupportsSELinux() bool {
return true
}
// This is the spec for the volume that this plugin wraps.
var wrappedVolumeSpec = &volume.Spec{
Volume: &api.Volume{VolumeSource: api.VolumeSource{EmptyDir: &api.EmptyDirVolumeSource{}}},