mirror of
https://github.com/psviderski/uncloud.git
synced 2026-11-11 05:04:16 +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 {
|
switch {
|
||||||
case isNewService:
|
case isNewService:
|
||||||
blockMod = " "
|
blockMod = " "
|
||||||
|
case len(oldLabels) == 0:
|
||||||
|
blockMod = tui.Green.Render("+")
|
||||||
case len(newLabels) == 0:
|
case len(newLabels) == 0:
|
||||||
blockMod = tui.Red.Render("-")
|
blockMod = tui.Red.Render("-")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ func TestServicePlan_Format(t *testing.T) {
|
|||||||
expected: []string{
|
expected: []string{
|
||||||
"~ update service web",
|
"~ update service web",
|
||||||
" │ image: nginx:1.25",
|
" │ image: nginx:1.25",
|
||||||
" │ ~ labels:",
|
" │ + labels:",
|
||||||
" │ + a=1",
|
" │ + a=1",
|
||||||
" │",
|
" │",
|
||||||
" ╰── ~ update container web/0f6df6593e1b on machine-1 (in place)",
|
" ╰── ~ update container web/0f6df6593e1b on machine-1 (in place)",
|
||||||
|
|||||||
Reference in New Issue
Block a user