diff --git a/configuration/config.go b/configuration/config.go index cabfb1d..b884627 100644 --- a/configuration/config.go +++ b/configuration/config.go @@ -78,6 +78,8 @@ func InitConfig() error { testDataPath = flag.String("test-data-path", "", "The path to a test data json file") groupsPath = flag.String("groups-path", "configuration/groups.yaml", "The path to a YAML file that maps user groups to scenario IDs") apiUpdateInterval = flag.String("api-update-interval", "10s" /* 10 sec */, "Interval in which API URL is queried for status updates of ICs") + rancherURL = flag.String("rancher-url", "rancher.k8s.eonerc.rwth-aachen.de", "URL of Rancher instance that is used to deploy the backend") + k8sCluster = flag.String("k8s-cluster", "local", "Name of the Kubernetes cluster where the backend is deployed") ) flag.Parse() @@ -110,6 +112,8 @@ func InitConfig() error { "groups.path": *groupsPath, "config.file": *configFile, "apiupdateinterval": *apiUpdateInterval, + "rancherURL": *rancherURL, + "k8sCluster": *k8sCluster, } if *dbClear == true { diff --git a/routes/config/config_endpoint.go b/routes/config/config_endpoint.go index f9f7ced..67ebbac 100644 --- a/routes/config/config_endpoint.go +++ b/routes/config/config_endpoint.go @@ -53,6 +53,8 @@ type Config struct { Mode string `json:"mode"` Contact ConfigContact `json:"contact"` Authentication ConfigAuthentication `json:"authentication"` + RancherURL string `json:"rancherURL"` + K8sCluster string `json:"k8sCluster"` } // getHealth godoc @@ -77,6 +79,8 @@ func getConfig(c *gin.Context) { resp.SubTitle, _ = cfg.String("sub-title") resp.Contact.Name, _ = cfg.String("contact.name") resp.Contact.Mail, _ = cfg.String("contact.mail") + resp.RancherURL, _ = cfg.String("rancherURL") + resp.K8sCluster, _ = cfg.String("k8sCluster") c.JSON(200, resp) }