Merge pull request #23546 from tmshn/dry-plan-color
make plan-diff format a bit more dry
This commit is contained in:
commit
ba9cb786c3
|
@ -70,22 +70,7 @@ func ResourceChange(
|
||||||
}
|
}
|
||||||
buf.WriteString(color.Color("[reset]\n"))
|
buf.WriteString(color.Color("[reset]\n"))
|
||||||
|
|
||||||
switch change.Action {
|
buf.WriteString(color.Color(DiffActionSymbol(change.Action)) + " ")
|
||||||
case plans.Create:
|
|
||||||
buf.WriteString(color.Color("[green] +[reset] "))
|
|
||||||
case plans.Read:
|
|
||||||
buf.WriteString(color.Color("[cyan] <=[reset] "))
|
|
||||||
case plans.Update:
|
|
||||||
buf.WriteString(color.Color("[yellow] ~[reset] "))
|
|
||||||
case plans.DeleteThenCreate:
|
|
||||||
buf.WriteString(color.Color("[red]-[reset]/[green]+[reset] "))
|
|
||||||
case plans.CreateThenDelete:
|
|
||||||
buf.WriteString(color.Color("[green]+[reset]/[red]-[reset] "))
|
|
||||||
case plans.Delete:
|
|
||||||
buf.WriteString(color.Color("[red] -[reset] "))
|
|
||||||
default:
|
|
||||||
buf.WriteString(color.Color("??? "))
|
|
||||||
}
|
|
||||||
|
|
||||||
switch addr.Resource.Resource.Mode {
|
switch addr.Resource.Resource.Mode {
|
||||||
case addrs.ManagedResourceMode:
|
case addrs.ManagedResourceMode:
|
||||||
|
|
Loading…
Reference in New Issue