From 465bb0653349edb4cf68fc97b809ad2281b3ae47 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 6 Sep 2018 10:36:15 +0200 Subject: [PATCH] glusterfs: improve a comment block moving it to the function it explains and rewording slightly. Signed-off-by: Michael Adam --- pkg/volume/glusterfs/glusterfs.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 7b7537cb03..c096ee888f 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -823,9 +823,6 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum } // The 'endpointname' is created in form of 'glusterfs-dynamic-'. - // createEndpointService() checks for this 'endpoint' existence in PVC's namespace and - // if not found, it create an endpoint and service using the IPs we dynamically picked at time - // of volume creation. epServiceName := dynamicEpSvcPrefix + string(p.options.PVC.UID) epNamespace := p.options.PVC.Namespace endpoint, service, err := p.createEndpointService(epNamespace, epServiceName, dynamicHostIps, p.options.PVC.Name) @@ -845,6 +842,10 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum }, sz, volID, nil } +// createEndpointService() makes sure an endpoint and service +// exist for the given namespace, PVC name, endpoint name, and +// set of IPs. I.e. the endpoint or service is only created +// if it does not exist yet. func (p *glusterfsVolumeProvisioner) createEndpointService(namespace string, epServiceName string, hostips []string, pvcname string) (endpoint *v1.Endpoints, service *v1.Service, err error) { addrlist := make([]v1.EndpointAddress, len(hostips))