Returns whether the maven configuration is the default value

This commit is contained in:
yangk 2021-05-18 12:54:53 +08:00
parent 0964ba3bff
commit 2b5af21d1a

View File

@ -223,6 +223,7 @@ type MavenSetting struct {
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
Content string `json:"content" validate:"required"`
IsDefault bool `json:"is_default"`
}
//MavenSettingList maven setting list
@ -234,11 +235,16 @@ func (c *clusterAction) MavenSettingList(ctx context.Context) (re []MavenSetting
logrus.Errorf("list maven setting config list failure %s", err.Error())
}
for _, sm := range cms.Items {
isDefault := false
if sm.Labels["default"] == "true" {
isDefault = true
}
re = append(re, MavenSetting{
Name: sm.Name,
CreateTime: sm.CreationTimestamp.Format(time.RFC3339),
UpdateTime: sm.Labels["updateTime"],
Content: sm.Data["mavensetting"],
IsDefault: isDefault,
})
}
return