mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-10 04:34:17 +00:00
fix(labels): format adding new labels in service plan with + modifier
This commit is contained in:
@@ -332,6 +332,8 @@ func formatLabelsDiff(attribute string, oldLabels, newLabels map[string]string,
|
||||
switch {
|
||||
case isNewService:
|
||||
blockMod = " "
|
||||
case len(oldLabels) == 0:
|
||||
blockMod = tui.Green.Render("+")
|
||||
case len(newLabels) == 0:
|
||||
blockMod = tui.Red.Render("-")
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ func TestServicePlan_Format(t *testing.T) {
|
||||
expected: []string{
|
||||
"~ update service web",
|
||||
" │ image: nginx:1.25",
|
||||
" │ ~ labels:",
|
||||
" │ + labels:",
|
||||
" │ + a=1",
|
||||
" │",
|
||||
" ╰── ~ update container web/0f6df6593e1b on machine-1 (in place)",
|
||||
|
||||
Reference in New Issue
Block a user