Merge pull request #32662 from humblec/glusterfs-default-volume

Automatic merge from submit-queue

Change the default volume type of GlusterFS provisioner.

At  present provisioner creates 'Distribute' Volume and  this patch change the default
volume type 'Distribute Replica:(3)' volume.
This commit is contained in:
Kubernetes Submit Queue 2016-09-15 18:07:14 -07:00 committed by GitHub
commit 9a3429829c

View File

@ -55,6 +55,8 @@ var _ volume.Deleter = &glusterfsVolumeDeleter{}
const ( const (
glusterfsPluginName = "kubernetes.io/glusterfs" glusterfsPluginName = "kubernetes.io/glusterfs"
volprefix = "vol_" volprefix = "vol_"
replicacount = 3
durabilitytype = "replicate"
) )
func (plugin *glusterfsPlugin) Init(host volume.VolumeHost) error { func (plugin *glusterfsPlugin) Init(host volume.VolumeHost) error {
@ -467,7 +469,7 @@ func (p *glusterfsVolumeProvisioner) CreateVolume() (r *api.GlusterfsVolumeSourc
glog.Errorf("glusterfs: failed to create gluster rest client") glog.Errorf("glusterfs: failed to create gluster rest client")
return nil, 0, fmt.Errorf("failed to create gluster REST client, REST server authentication failed") return nil, 0, fmt.Errorf("failed to create gluster REST client, REST server authentication failed")
} }
volumeReq := &gapi.VolumeCreateRequest{Size: sz} volumeReq := &gapi.VolumeCreateRequest{Size: sz, Durability: gapi.VolumeDurabilityInfo{Type: durabilitytype, Replicate: gapi.ReplicaDurability{Replica: replicacount}}}
volume, err := cli.VolumeCreate(volumeReq) volume, err := cli.VolumeCreate(volumeReq)
if err != nil { if err != nil {
glog.Errorf("glusterfs: error creating volume %s ", err) glog.Errorf("glusterfs: error creating volume %s ", err)