diff --git a/configuration/config.go b/configuration/config.go index 51cd549..17949a5 100644 --- a/configuration/config.go +++ b/configuration/config.go @@ -84,8 +84,8 @@ func InitConfig() error { testDataPath = flag.String("test-data-path", "", "The path to a test data json file") groupsPath = flag.String("groups-path", "", "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") + k8sRancherURL = flag.String("k8s-rancher-url", "https://rancher.k8s.eonerc.rwth-aachen.de", "URL of Rancher instance that is used to deploy the backend") + k8sClusterName = flag.String("k8s-cluster-name", "local", "Name of the Kubernetes cluster where the backend is deployed") ) flag.Parse() @@ -119,8 +119,8 @@ func InitConfig() error { "groups.path": *groupsPath, "config.file": *configFile, "apiupdateinterval": *apiUpdateInterval, - "rancherURL": *rancherURL, - "k8sCluster": *k8sCluster, + "k8s.rancher-url": *k8sRancherURL, + "k8s.cluster-name": *k8sClusterName, } if *dbClear { diff --git a/routes/config/config_endpoint.go b/routes/config/config_endpoint.go index 67ebbac..9b6ceaa 100644 --- a/routes/config/config_endpoint.go +++ b/routes/config/config_endpoint.go @@ -47,14 +47,18 @@ type ConfigContact struct { Mail string `json:"mail"` } +type ConfigKubernetes struct { + RancherURL string `json:"rancher_url"` + ClusterName string `json:"cluster_name"` +} + type Config struct { Title string `json:"title"` SubTitle string `json:"sub_title"` Mode string `json:"mode"` Contact ConfigContact `json:"contact"` Authentication ConfigAuthentication `json:"authentication"` - RancherURL string `json:"rancherURL"` - K8sCluster string `json:"k8sCluster"` + Kubernetes ConfigKubernetes `json:"kubernetes"` } // getHealth godoc @@ -79,8 +83,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") + resp.Kubernetes.RancherURL, _ = cfg.String("k8s.rancher-url") + resp.Kubernetes.ClusterName, _ = cfg.String("k8s.cluster-name") c.JSON(200, resp) }