Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONSOLE-2458: Add checkbox for cleaning up operand when uninstalling operator #9142

Conversation

dtaylor113
Copy link
Contributor

@dtaylor113 dtaylor113 commented Jun 3, 2021

Updated Uninstall Operator Modal:

  1. cherry-picked CONSOLE-2458: Add endpoint for listing operators operands #8949
  2. integrated with 'list-operands' endpoint
  3. added Operands table and 'delete all operands' checkbox to modal body
  4. Upon submit, added k8kill cmds to delete all operands
  5. Updated Error reporting and Alerts

BEFORE SUBMIT

image

console>kubectl operator list-operands argocd-operator -n openshift-operators
APIVERSION            KIND          NAMESPACE            NAME                                     AGE
argoproj.io/v1alpha1  AppProject    daves-project        default                                  3m
argoproj.io/v1alpha1  AppProject    openshift-operators  default                                  2m46s
argoproj.io/v1alpha1  ArgoCD        daves-project        example-argocd                           3m37s
argoproj.io/v1alpha1  ArgoCD        openshift-operators  example-argocd-in-os-operators-ns        2m51s
argoproj.io/v1alpha1  ArgoCDExport  daves-project        example-argocdexport                     3m28s
argoproj.io/v1alpha1  ArgoCDExport  openshift-operators  example-argocdexport-in-os-operators-ns  2m43s

console>kubectl get AppProject -A
NAMESPACE             NAME      AGE
daves-project         default   7m21s
openshift-operators   default   7m7s

AFTER SUBMIT

console>kubectl operator list-operands argocd-operator -n openshift-operators
list operands: could not find underlying CSV for operator argocd-operator.openshift-operators

console>kubectl get AppProject -A
No resources found

AFTER SUBMIT (with 'delete all operands' NOT checked!)

console>kubectl operator list-operands argocd-operator -n openshift-operators
list operands: could not find underlying CSV for operator argocd-operator.openshift-operators

console>kubectl get AppProject -A
NAMESPACE             NAME      AGE
daves-project         default   7m21s
openshift-operators   default   7m7s

AFTER SUBMIT Errors and Alerts

image

Please see these screenshots of all possible submit results.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. component/core Related to console core functionality component/olm Related to OLM kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Jun 3, 2021
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

Thanks @dtaylor113. Great to see progress on this.

Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

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

Code looks good 👍
Found few nits.

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from e85f048 to a27de04 Compare June 8, 2021 18:55
@openshift-ci openshift-ci bot added the component/shared Related to console-shared label Jun 8, 2021
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from a27de04 to e4aeb4d Compare June 8, 2021 19:39
@dtaylor113
Copy link
Contributor Author

dtaylor113 commented Jun 8, 2021

Hi, I've addressed:

  • new useOperandsWatcher
  • replaced the full resource table component with simple inline table
  • misc. comments
  • error handling and alerting during submit and removing operand instances

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from e4aeb4d to e598e23 Compare June 9, 2021 13:46
@openshift openshift deleted a comment from openshift-ci bot Jun 9, 2021
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch 2 times, most recently from 3201869 to 9da920f Compare June 9, 2021 15:38
@openshift openshift deleted a comment from openshift-ci bot Jun 9, 2021
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch 2 times, most recently from 8b86d44 to ca83a1e Compare June 18, 2021 15:27
@openshift openshift deleted a comment from openshift-ci bot Jun 18, 2021
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from ca83a1e to 3567227 Compare June 18, 2021 18:39
@openshift openshift deleted a comment from openshift-ci bot Jun 18, 2021
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

Nice work! Most of my comments are just nits on best practices and consistency stuff. I do think the small helper components that you declared inside the modal component should probably be moved into separate components so that React can do it's job and re-render those only as necessary.

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch 3 times, most recently from 54034ce to 6463150 Compare June 23, 2021 20:18
@dtaylor113
Copy link
Contributor Author

Hi @TheRealJon, I believe I have address all of your review comments -thanks

@openshift-ci openshift-ci bot added the kind/cypress Related to Cypress e2e integration testing label Jun 25, 2021
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from ac4e59c to 4b80bbb Compare June 25, 2021 20:04
cancel?: () => void;
};

type operandErrorsProps = { operand: K8sResourceCommon; errorMessage: string };
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't call this props since it's not a components. Types should have a uppercase first letter.

Suggested change
type operandErrorsProps = { operand: K8sResourceCommon; errorMessage: string };
type OperandError = { operand: K8sResourceCommon; errorMessage: string };

Copy link
Contributor Author

@dtaylor113 dtaylor113 Sep 2, 2021

Choose a reason for hiding this comment

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

renamed

);
};

const OperandErrorsList: React.FC<OperandErrorsListProps> = ({
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const OperandErrorsList: React.FC<OperandErrorsListProps> = ({
const OperandErrorList: React.FC<OperandErrorListProps> = ({

Copy link
Contributor Author

@dtaylor113 dtaylor113 Sep 2, 2021

Choose a reason for hiding this comment

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

renamed

@spadgett
Copy link
Member

spadgett commented Sep 2, 2021

Hi @yanpzhan, currently resources are sorted by name, we are considering changing to sort by kind then namespace then name.

Let's not block the feature on this. We can handle this in a follow on.

@spadgett
Copy link
Member

spadgett commented Sep 2, 2021

Looks good overall. Just some minor comments, but we should be able to go ahead and test.

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from e34245f to 7447329 Compare September 2, 2021 20:19
@dtaylor113
Copy link
Contributor Author

Hi @yanpzhan, test case lgtm -thanks

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

One nit, otherwise LGTM. We'll need QE approval. Thanks @dtaylor113 !

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from 7447329 to 592b08a Compare September 2, 2021 20:33
@spadgett
Copy link
Member

spadgett commented Sep 2, 2021

@dtaylor113 Will need rebase

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 2, 2021
@yanpzhan
Copy link
Contributor

yanpzhan commented Sep 3, 2021

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Sep 3, 2021
@spadgett
Copy link
Member

spadgett commented Sep 3, 2021

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 3, 2021
@spadgett
Copy link
Member

spadgett commented Sep 3, 2021

@dtaylor113 Needs rebase :/

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from 592b08a to 4b4d504 Compare September 3, 2021 14:05
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 3, 2021
@dtaylor113
Copy link
Contributor Author

@spadgett, rebased

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2021
@spadgett
Copy link
Member

spadgett commented Sep 3, 2021

/retest

@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from 4b4d504 to 687db79 Compare September 3, 2021 17:54
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2021
…dded Operands table, 'delete all' checkbox, and k8kill cmds to delete operands
@dtaylor113 dtaylor113 force-pushed the operand-deletion-during-uninstall branch from 687db79 to 682f7cb Compare September 3, 2021 18:43
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 3, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtaylor113, spadgett, TheRealJon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [TheRealJon,spadgett]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 66b8801 into openshift:master Sep 4, 2021
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. component/backend Related to backend component/core Related to console core functionality component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared docs-approved Signifies that Docs has signed off on this PR kind/cypress Related to Cypress e2e integration testing kind/dependency-change Categorizes issue or PR as related to changing dependencies kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants