Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

Commit 573f7ba

Browse files
author
Kiran Mova
authored
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 <[email protected]>
1 parent 98290ce commit 573f7ba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

openebs/pkg/v1/maya_api.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,16 @@ func (v OpenEBSVolume) GetMayaClusterIP(client kubernetes.Interface) (string, er
6161
}
6262

6363
glog.Info("OpenEBS volume provisioner namespace ", namespace)
64+
6465
//Fetch the Maya ClusterIP using the Maya API Server Service
65-
sc, err := client.CoreV1().Services(namespace).Get("maya-apiserver-service", metav1.GetOptions{})
66+
mayaAPIServiceName := os.Getenv("OPENEBS_MAYA_SERVICE_NAME")
67+
if mayaAPIServiceName == "" {
68+
mayaAPIServiceName = "maya-apiserver-service"
69+
}
70+
71+
sc, err := client.CoreV1().Services(namespace).Get(mayaAPIServiceName, metav1.GetOptions{})
6672
if err != nil {
67-
glog.Errorf("Error getting maya-apiserver IP Address: %v", err)
73+
glog.Errorf("Error getting IP Address for service - %s : %v", mayaAPIServiceName, err)
6874
}
6975

7076
clusterIP = sc.Spec.ClusterIP

0 commit comments

Comments
 (0)