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.
This commit is contained in:
Jan Safranek 2015-04-21 12:33:59 +02:00
parent 21788d8e66
commit 0293c6b7f0

View File

@ -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)