align name of kubernetes related backend options to naming scheme

This commit is contained in:
Steffen Vogel 2021-10-19 19:04:10 +02:00
parent b3ba58647c
commit 8e5e9c2257
2 changed files with 12 additions and 8 deletions

View file

@ -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 {

View file

@ -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)
}