fix: get clusters by api (#1030)

This commit is contained in:
Yening Qin 2022-07-07 12:29:35 +08:00 committed by GitHub
parent 98d5dfff8e
commit 315e0ef903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -87,9 +87,9 @@ type DSReply struct {
Settings struct {
PrometheusAddr string `json:"prometheus.addr"`
PrometheusBasic struct {
PrometheusUser string `json:"promethues.user"`
PrometheusPass string `json:"promethues.password"`
} `json:"promethues.basic"`
PrometheusUser string `json:"prometheus.user"`
PrometheusPass string `json:"prometheus.password"`
} `json:"prometheus.basic"`
PrometheusTimeout int64 `json:"prometheus.timeout"`
} `json:"settings,omitempty"`
} `json:"items"`
@ -137,6 +137,7 @@ func loadClustersFromAPI() {
logger.Errorf("read response body of %s fail: %v", url, err)
continue
}
logger.Debugf("curl %s success, response: %s", url, string(jsonBytes))
err = json.Unmarshal(jsonBytes, &reply)
if err != nil {