From 0293c6b7f0de6682002a033d39bcd75556d68452 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 21 Apr 2015 12:33:59 +0200 Subject: [PATCH] Use pod namespace when looking for its GlusterFS endpoints. I have a pod, which exports a Gluster filesystem in non-default namespace. When I try to use this FS as a GlusterfsVolumeSource in a 'client' pod definition, Kubernetes looks for the appropriate endpoint in 'default' namespace instead of the namespace where the client pod is being defined. --- pkg/volume/glusterfs/glusterfs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 336e9223760..f59431c4567 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -67,7 +67,7 @@ func (plugin *glusterfsPlugin) GetAccessModes() []api.AccessModeType { func (plugin *glusterfsPlugin) NewBuilder(spec *volume.Spec, podRef *api.ObjectReference, _ volume.VolumeOptions) (volume.Builder, error) { ep_name := spec.VolumeSource.Glusterfs.EndpointsName - ns := api.NamespaceDefault + ns := podRef.Namespace ep, err := plugin.host.GetKubeClient().Endpoints(ns).Get(ep_name) if err != nil { glog.Errorf("Glusterfs: failed to get endpoints %s[%v]", ep_name, err)