Skip to content

Conversation

estroz
Copy link
Member

@estroz estroz commented Sep 10, 2019

Description of the change: make CLI output text consistent across internal/olm, and return certain resource errors in Status.HasInstalledResources().

Motivation for the change: CLI output is easier to read. Output when running olm install on a cluster that already has an OLM deployment now prints existing resource status. Resource.Error is now also checked in Status.HasInstalledResources() so any errors that indicate the resource might exist (is not a not-found error) are returned.

@estroz estroz added the olm-integration Issue relates to the OLM integration label Sep 10, 2019
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 10, 2019
@estroz estroz force-pushed the olm-unify-cli-output branch from 8faa84a to 66fd308 Compare September 10, 2019 19:47
@estroz
Copy link
Member Author

estroz commented Sep 10, 2019

/test e2e-aws-helm

@estroz
Copy link
Member Author

estroz commented Sep 10, 2019

/test e2e-aws-subcommand

1 similar comment
@estroz
Copy link
Member Author

estroz commented Sep 10, 2019

/test e2e-aws-subcommand

@estroz estroz requested a review from joelanford September 12, 2019 18:36
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2019
@estroz estroz force-pushed the olm-unify-cli-output branch from 9485462 to 527a85e Compare November 8, 2019 20:55
@estroz
Copy link
Member Author

estroz commented Nov 8, 2019

@joelanford @camilamacedo86 seems to be working now with @joelanford's suggested changes. PTAL.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm /approved
when it pass in the CI

@estroz estroz force-pushed the olm-unify-cli-output branch from 527a85e to e514942 Compare November 19, 2019 00:31
@camilamacedo86 camilamacedo86 added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Nov 21, 2019
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 22, 2019
Comment on lines 121 to 130
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
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use something like this:

var status *HelmAppStatus
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(s, &status); err != nil {
return &HelmAppStatus{}
}

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:" +
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@camilamacedo86 camilamacedo86 added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2019
@estroz estroz merged commit 7dab655 into operator-framework:master Dec 4, 2019
@estroz estroz deleted the olm-unify-cli-output branch April 1, 2020 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. olm-integration Issue relates to the OLM integration size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants