Merge pull request #35285 from humblec/glusterfs-stale-volumes

Automatic merge from submit-queue

Remove stale volumes if endpoint/svc creation fails.

Remove stale volumes if endpoint/svc creation fails.

Signed-off-by: Humble Chirammal hchiramm@redhat.com
This commit is contained in:
Kubernetes Submit Queue 2016-10-31 04:06:43 -07:00 committed by GitHub
commit 106492708a

View File

@ -550,6 +550,10 @@ func (p *glusterfsVolumeProvisioner) CreateVolume() (r *api.GlusterfsVolumeSourc
endpoint, service, err := p.createEndpointService(epNamespace, epServiceName, dynamicHostIps, p.options.PVC.Name)
if err != nil {
glog.Errorf("glusterfs: failed to create endpoint/service")
err = cli.VolumeDelete(volume.Id)
if err != nil {
glog.Errorf("glusterfs: error when deleting the volume :%v , manual deletion required", err)
}
return nil, 0, fmt.Errorf("failed to create endpoint/service %v", err)
}
glog.V(3).Infof("glusterfs: dynamic ep %v and svc : %v ", endpoint, service)