Merge pull request #23546 from tmshn/dry-plan-color

make plan-diff format a bit more dry
This commit is contained in:
Pam Selle 2019-12-04 17:24:27 -05:00 committed by GitHub
commit ba9cb786c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 16 deletions

View File

@ -70,22 +70,7 @@ func ResourceChange(
}
buf.WriteString(color.Color("[reset]\n"))
switch 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("??? "))
}
buf.WriteString(color.Color(DiffActionSymbol(change.Action)) + " ")
switch addr.Resource.Resource.Mode {
case addrs.ManagedResourceMode: