mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-10 20:54:17 +00:00
feat(labels): support service and container labels, update labels and cpu/memory in-place
This commit is contained in:
@@ -173,7 +173,7 @@ func (sp *ServicePlan) Format() string {
|
||||
|
||||
// FormatSummary counts operations in the service plan and renders a styled summary line.
|
||||
func (sp *ServicePlan) FormatSummary() string {
|
||||
var createCount, startFirstCount, stopFirstCount, removeCount int
|
||||
var createCount, startFirstCount, stopFirstCount, updateCount, removeCount int
|
||||
machines := make(map[string]struct{})
|
||||
|
||||
for _, op := range sp.Operations {
|
||||
@@ -188,6 +188,9 @@ func (sp *ServicePlan) FormatSummary() string {
|
||||
} else {
|
||||
startFirstCount++
|
||||
}
|
||||
case *operation.UpdateContainerOperation:
|
||||
machines[o.MachineID] = struct{}{}
|
||||
updateCount++
|
||||
case *operation.RemoveContainerOperation:
|
||||
machines[o.MachineID] = struct{}{}
|
||||
removeCount++
|
||||
@@ -210,6 +213,10 @@ func (sp *ServicePlan) FormatSummary() string {
|
||||
parts = append(parts,
|
||||
tui.BoldYellow.Render(strconv.Itoa(stopFirstCount))+" "+tui.Yellow.Render("replace (stop-first)"))
|
||||
}
|
||||
if updateCount > 0 {
|
||||
parts = append(parts,
|
||||
tui.BoldYellow.Render(strconv.Itoa(updateCount))+" "+tui.Yellow.Render("update (in place)"))
|
||||
}
|
||||
if removeCount > 0 {
|
||||
parts = append(parts,
|
||||
tui.BoldRed.Render(strconv.Itoa(removeCount))+" "+tui.Red.Render("remove"))
|
||||
|
||||
Reference in New Issue
Block a user