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

MGMT-4261 Agent CR and ACI cleanup when deleting CD #1606

Conversation

nmagnezi
Copy link
Contributor

@nmagnezi nmagnezi commented Apr 28, 2021

clusterdeployments_controller:
When a CD CR gets deleted, the controller will place a
finalizer to trigger a pre-deletion cleanup.

The cleanup includes ACI deletion, which will place a finalizer on ACI.

ACI finalizer includes backend-cluster deregister and deletion of the
cluster agent resources.

As for subsystem tests:

  1. Tests will now assert for agent deletion per ACI removal.
  2. Tests will now assert for agent deletion and ACI per CD removal.
  3. Each test will now use a unique CD and ACI CR name - to provide better
    test isolation. This was also done because deletion via finalizers
    takes an additional reconcile to be fully deleted.
  4. Per 2, and to avoid any cleanup bugs, the cleanup done for subsystem
    tests (AfterEach) is now followed up by verifyCleanUP

P.S.
Note that this PR does not cover host deregister upon Agent CR deletion,
which was added in #1642

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nmagnezi

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:

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 28, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from 839e545 to 9be4d5a Compare April 28, 2021 12:57
@nmagnezi
Copy link
Contributor Author

/hold
adding tests

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 28, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from 9be4d5a to d4bc572 Compare April 28, 2021 15:03
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from d4bc572 to f6b77cb Compare April 28, 2021 15:57
@nmagnezi
Copy link
Contributor Author

/unhold

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 28, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from f6b77cb to 2932f0a Compare April 28, 2021 20:33
@nmagnezi nmagnezi requested review from mhrivnak and dgoodwin April 28, 2021 20:35
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from 2932f0a to a73b8fe Compare April 29, 2021 09:00
@nmagnezi
Copy link
Contributor Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 29, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch 4 times, most recently from 7083470 to d4b543a Compare May 2, 2021 16:00
@nmagnezi
Copy link
Contributor Author

nmagnezi commented May 2, 2021

/unhold

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 2, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from d4b543a to b0b7824 Compare May 2, 2021 21:22
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from b0b7824 to 1d6633e Compare May 3, 2021 06:21
@nmagnezi
Copy link
Contributor Author

/assign @rollandf
/assign @RazRegev
/assign @danielerez
/assign @eliorerz

@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from d9199fc to 9e52e87 Compare May 23, 2021 08:44
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 23, 2021
@rollandf
Copy link

/retest

@nmagnezi
Copy link
Contributor Author

/test e2e-metal-assisted-kube-api

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from 9e52e87 to 746fd31 Compare May 23, 2021 15:14
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 23, 2021
@nmagnezi
Copy link
Contributor Author

New changes are detected. LGTM label has been removed.

Rebased to resolve conflicts.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2021
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from 746fd31 to ec398e7 Compare May 23, 2021 19:13
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2021
@nmagnezi
Copy link
Contributor Author

/test subsystem-kubeapi-aws

clusterdeployments_controller:
When a CD CR gets deleted, the controller will place a
finalizer to trigger a pre-deletion cleanup.

The cleanup includes ACI deletion, which will place a finalizer on ACI.

ACI finalizer includes backend-cluster deregister and deletion of the
cluster agent resources.

As for subsystem tests:
1. Tests will now assert for agent deletion per ACI removal.
2. Tests will now assert for agent deletion and ACI per CD removal.
3. Each test will now use a unique CD and ACI CR name - to provide better
   test isolation. This was also done because deletion via finalizers
   takes an additional reconcile to be fully deleted.
4. Per 2, and to avoid any cleanup bugs, the cleanup done for subsystem
   tests (AfterEach) is now followed up by verifyCleanUP

P.S.
Note that this PR does not cover host deregister upon Agent CR deletion,
which was added in openshift#1642
@nmagnezi nmagnezi force-pushed the MGMT-4261_del_agents_with_clusterDeployment branch from ec398e7 to fb36ee6 Compare May 24, 2021 10:39
@rollandf
Copy link

/lgtm

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

openshift-ci bot commented May 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: filanov, nmagnezi

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:

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 92daefb into openshift:master May 24, 2021
@nmagnezi nmagnezi deleted the MGMT-4261_del_agents_with_clusterDeployment branch May 24, 2021 13:35
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.