From 573f7ba914ed10b0d53d55d6fe02ffc33010723c Mon Sep 17 00:00:00 2001 From: Kiran Mova Date: Sun, 11 Feb 2018 23:20:59 +0530 Subject: [PATCH] make the maya-apiserver-service configurable via ENV OPENEBS_MAYA_SERVICE_NAME can be used to pass the name of the openebs-provisioner name. If the ENV is not present, openebs-provisioner will try to connect with : maya-apiserver-service Signed-off-by: kmova --- openebs/pkg/v1/maya_api.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openebs/pkg/v1/maya_api.go b/openebs/pkg/v1/maya_api.go index 2117fa38df6..da277b8d0bd 100644 --- a/openebs/pkg/v1/maya_api.go +++ b/openebs/pkg/v1/maya_api.go @@ -61,10 +61,16 @@ func (v OpenEBSVolume) GetMayaClusterIP(client kubernetes.Interface) (string, er } glog.Info("OpenEBS volume provisioner namespace ", namespace) + //Fetch the Maya ClusterIP using the Maya API Server Service - sc, err := client.CoreV1().Services(namespace).Get("maya-apiserver-service", metav1.GetOptions{}) + mayaAPIServiceName := os.Getenv("OPENEBS_MAYA_SERVICE_NAME") + if mayaAPIServiceName == "" { + mayaAPIServiceName = "maya-apiserver-service" + } + + sc, err := client.CoreV1().Services(namespace).Get(mayaAPIServiceName, metav1.GetOptions{}) if err != nil { - glog.Errorf("Error getting maya-apiserver IP Address: %v", err) + glog.Errorf("Error getting IP Address for service - %s : %v", mayaAPIServiceName, err) } clusterIP = sc.Spec.ClusterIP