internal/olm: make CLI output text more consistent; check resource errors#1902
internal/olm: make CLI output text more consistent; check resource errors#1902estroz merged 11 commits intooperator-framework:masterfrom
Conversation
8faa84a to
66fd308
Compare
|
/test e2e-aws-helm |
|
/test e2e-aws-subcommand |
1 similar comment
|
/test e2e-aws-subcommand |
camilamacedo86
left a comment
There was a problem hiding this comment.
All shows great.
Just the nomenclature of the bool func should be changed in order to respect the good practices for Has instead of NOX.
9485462 to
527a85e
Compare
|
@joelanford @camilamacedo86 seems to be working now with @joelanford's suggested changes. PTAL. |
camilamacedo86
left a comment
There was a problem hiding this comment.
/lgtm /approved
when it pass in the CI
527a85e to
e514942
Compare
|
New changes are detected. LGTM label has been removed. |
| vb, err := v.MarshalJSON() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| // Use unversioned CustomResourceDefinition to avoid implementing cast | ||
| // for all versions. | ||
| obj, _, err := dec.Decode(vb, nil, nil) | ||
| if err != nil { | ||
| return nil, err | ||
| } |
There was a problem hiding this comment.
Is it possible to use something like this:
operator-sdk/pkg/helm/internal/types/types.go
Lines 138 to 141 in 3c8e5e7
| return nil, errors.New("detected existing OLM resources: OLM must be completely uninstalled before installation" + | ||
| fmt.Sprintf("\nResources:\n%s", status.String())) | ||
| } else if err != nil { | ||
| return nil, errors.New("detected errored OLM resources:" + |
There was a problem hiding this comment.
@joelanford wdyt about "detected errored OLM resources, see resource statuses for more details" as an alternative error message? I'm hesitant to wrap err here since it contains error information for only one resource.
Description of the change: make CLI output text consistent across
internal/olm, and return certain resource errors inStatus.HasInstalledResources().Motivation for the change: CLI output is easier to read. Output when running
olm installon a cluster that already has an OLM deployment now prints existing resource status.Resource.Erroris now also checked inStatus.HasInstalledResources()so any errors that indicate the resource might exist (is not a not-found error) are returned.