mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 04:40:05 +01:00
feat: add docker_image and docker_tag to cluster api
Signed-off-by: allanice001 <allanice001@gmail.com>
This commit is contained in:
@@ -189,6 +189,8 @@ func CreateCluster(db *gorm.DB) http.HandlerFunc {
|
||||
LastError: "",
|
||||
CertificateKey: certificateKey,
|
||||
RandomToken: randomToken,
|
||||
DockerImage: in.DockerImage,
|
||||
DockerTag: in.DockerTag,
|
||||
}
|
||||
|
||||
if err := db.Create(&c).Error; err != nil {
|
||||
@@ -262,6 +264,14 @@ func UpdateCluster(db *gorm.DB) http.HandlerFunc {
|
||||
cluster.Region = *in.Region
|
||||
}
|
||||
|
||||
if in.DockerImage != nil {
|
||||
cluster.DockerImage = *in.DockerImage
|
||||
}
|
||||
|
||||
if in.DockerTag != nil {
|
||||
cluster.DockerTag = *in.DockerTag
|
||||
}
|
||||
|
||||
if err := db.Save(&cluster).Error; err != nil {
|
||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||
return
|
||||
@@ -1547,6 +1557,8 @@ func clusterToDTO(c models.Cluster) dto.ClusterResponse {
|
||||
RandomToken: c.RandomToken,
|
||||
CertificateKey: c.CertificateKey,
|
||||
NodePools: nps,
|
||||
DockerImage: c.DockerImage,
|
||||
DockerTag: c.DockerTag,
|
||||
CreatedAt: c.CreatedAt,
|
||||
UpdatedAt: c.UpdatedAt,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user