Skip to content

Commit

Permalink
word wrap long reconcile reason in inspect view
Browse files Browse the repository at this point in the history
  • Loading branch information
cppforlife committed Jul 17, 2019
1 parent 0d831d1 commit 4995925
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/kapp/cmd/tools/inspect_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
ctlcap "github.com/k14s/kapp/pkg/kapp/clusterapply"
cmdcore "github.com/k14s/kapp/pkg/kapp/cmd/core"
ctlres "github.com/k14s/kapp/pkg/kapp/resources"
"github.com/mitchellh/go-wordwrap"
)

type InspectView struct {
Expand Down Expand Up @@ -101,7 +102,7 @@ func NewValueResourceConverged(resource ctlres.Resource) ValueResourceConverged
state, err := ctlcap.NewConvergedResource(resource, nil).IsDoneApplying(&noopUI{})
if err != nil {
stateVal = uitable.ValueFmt{V: uitable.NewValueString("error"), Error: true}
reasonVal = uitable.NewValueString(err.Error())
reasonVal = uitable.NewValueString(wordwrap.WrapString(err.Error(), 35))
} else {
switch {
case state.Done && state.Successful:
Expand All @@ -111,7 +112,7 @@ func NewValueResourceConverged(resource ctlres.Resource) ValueResourceConverged
case !state.Done:
stateVal = uitable.ValueFmt{V: uitable.NewValueString("ongoing"), Error: true}
}
reasonVal = uitable.NewValueString(state.Message)
reasonVal = uitable.NewValueString(wordwrap.WrapString(state.Message, 35))
}

return ValueResourceConverged{stateVal, reasonVal}
Expand Down
21 changes: 21 additions & 0 deletions vendor/github.com/mitchellh/go-wordwrap/LICENSE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions vendor/github.com/mitchellh/go-wordwrap/wordwrap.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4995925

Please sign in to comment.