Skip to content

Commit

Permalink
Merge pull request #35285 from humblec/glusterfs-stale-volumes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Kubernetes Submit Queue committed Oct 31, 2016
2 parents ddce7c3 + 9026347 commit 1064927
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/volume/glusterfs/glusterfs.go
Expand Up @@ -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)
Expand Down

0 comments on commit 1064927

Please sign in to comment.