mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
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:
parent
21788d8e66
commit
0293c6b7f0
@ -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) {
|
func (plugin *glusterfsPlugin) NewBuilder(spec *volume.Spec, podRef *api.ObjectReference, _ volume.VolumeOptions) (volume.Builder, error) {
|
||||||
ep_name := spec.VolumeSource.Glusterfs.EndpointsName
|
ep_name := spec.VolumeSource.Glusterfs.EndpointsName
|
||||||
ns := api.NamespaceDefault
|
ns := podRef.Namespace
|
||||||
ep, err := plugin.host.GetKubeClient().Endpoints(ns).Get(ep_name)
|
ep, err := plugin.host.GetKubeClient().Endpoints(ns).Get(ep_name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Glusterfs: failed to get endpoints %s[%v]", ep_name, err)
|
glog.Errorf("Glusterfs: failed to get endpoints %s[%v]", ep_name, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user