From 745f12837f849cd9854c451fb2b3fcc807bc2d1e Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 2 May 2019 21:06:34 +0530 Subject: [PATCH] Rename createEndpointService() to createOrGetEndpointService() Signed-off-by: Humble Chirammal --- pkg/volume/glusterfs/glusterfs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index ff597b9d3c2..30ff3d64330 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -815,7 +815,7 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsPersi epServiceName = p.provisionerConfig.customEpNamePrefix + "-" + string(p.options.PVC.UID) } epNamespace := p.options.PVC.Namespace - endpoint, service, err := p.createEndpointService(epNamespace, epServiceName, p.options.PVC) + endpoint, service, err := p.createOrGetEndpointService(epNamespace, epServiceName, p.options.PVC) if err != nil { klog.Errorf("failed to create endpoint/service %v/%v: %v", epNamespace, epServiceName, err) return nil, 0, "", fmt.Errorf("failed to create endpoint/service %v/%v: %v", epNamespace, epServiceName, err) @@ -915,11 +915,11 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsPersi }, sz, volID, nil } -// createEndpointService() makes sure an endpoint and service +// createOrGetEndpointService() makes sure an endpoint and service // exist for the given namespace, PVC name, endpoint name // I.e. the endpoint or service is only created // if it does not exist yet. -func (p *glusterfsVolumeProvisioner) createEndpointService(namespace string, epServiceName string, pvc *v1.PersistentVolumeClaim) (endpoint *v1.Endpoints, service *v1.Service, err error) { +func (p *glusterfsVolumeProvisioner) createOrGetEndpointService(namespace string, epServiceName string, pvc *v1.PersistentVolumeClaim) (endpoint *v1.Endpoints, service *v1.Service, err error) { pvcNameOrID := "" if len(pvc.Name) >= 63 { pvcNameOrID = string(pvc.UID)