Skip to content

Commit

Permalink
fix BUG: upgrade cluster missing packageVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
YenchangChan authored and yuzhichang committed Mar 9, 2021
1 parent 2314146 commit 6f17fcb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion controller/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,16 @@ func (ck *ClickHouseController) QueryInfo(c *gin.Context) {
// @Success 200 {string} json "{"code":200,"msg":"success","data":null}"
// @Router /api/v1/ck/upgrade/{clusterName} [put]
func (ck *ClickHouseController) UpgradeCk(c *gin.Context) {
var req model.CkUpgradeCk
var conf model.CKManClickHouseConfig
clusterName := c.Param(ClickHouseClusterPath)
packageVersion := c.Query("packageVersion")

if err := model.DecodeRequestBody(c.Request, &req); err != nil {
model.WrapMsg(c, model.INVALID_PARAMS, model.GetMsg(c, model.INVALID_PARAMS), err.Error())
return
}

packageVersion := req.PackageVersion

con, ok := clickhouse.CkClusters.Load(clusterName)
if !ok {
Expand Down
4 changes: 4 additions & 0 deletions model/ck_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ type CkTableCost struct {
SecondaryMax float64 `json:"secondaryMax"`
Max float64 `json:"max"`
}

type CkUpgradeCk struct {
PackageVersion string `json:"packageVersion"`
}

0 comments on commit 6f17fcb

Please sign in to comment.