-
Notifications
You must be signed in to change notification settings - Fork 199
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-17893: Don't destroy cluster on detach #6532
MGMT-17893: Don't destroy cluster on detach #6532
Conversation
@jhernand: This pull request references MGMT-17893 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6532 +/- ##
==========================================
- Coverage 68.43% 68.42% -0.01%
==========================================
Files 247 247
Lines 36416 36425 +9
==========================================
+ Hits 24920 24923 +3
- Misses 9290 9294 +4
- Partials 2206 2208 +2
|
@jhernand: This pull request references MGMT-17893 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a few minor test questions.
TypeMeta: metav1.TypeMeta{ | ||
Kind: "InfraEnv", | ||
APIVersion: fmt.Sprintf("%s/%s", aiv1beta1.GroupVersion.Group, aiv1beta1.GroupVersion.Version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You generally shouldn't need to set TypeMeta like this. Is there a reason you're doing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy & paste, from the test above. Will remove it.
Currently the procedure to detach a cluster that was created using hosts from a late binding pool is to first delete the `ManagedCluster` object, then add the `preserveOnDelete: true` field to the `ClusterDeployment` and then delete that `ClusterDeployment`. But the cluster deployment controller doesn't look at the `preserveOnDelete` field at all. As a result the hosts of the cluster are returned to the pool and they are provisioned again, which effectively destroys the cluster. This patch changes the deployment manager controller so that in that case it will check the `preserveOnDelete` field and if it is `true` it will delete the corresponding `Agent` objects. The result of that is that the hosts will go back to the pool, but marked the will still be marked as provisioned and they will not be provisioned again, thus avoiding the destruction of the cluster. Note that the `BareMetalHosts` will not be removed, but they will stay detached. Related: https://issues.redhat.com/browse/MGMT-17893 Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
6374327
to
3ee8313
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carbonin, jhernand 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 |
@jhernand: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
[ART PR BUILD NOTIFIER] This PR has been included in build ose-agent-installer-api-server-container-v4.17.0-202407100011.p0.gd2bba26.assembly.stream.el9 for distgit ose-agent-installer-api-server. |
/cherry-pick release-ocm-2.11 |
@jhernand: new pull request created: #6556 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Currently the procedure to detach a cluster that was created using hosts from a late binding pool is to first delete the
ManagedCluster
object, then add thepreserveOnDelete: true
field to theClusterDeployment
and then delete thatClusterDeployment
. But the cluster deployment controller doesn't look at thepreserveOnDelete
field at all. As a result the hosts of the cluster are returned to the pool and they are provisioned again, which effectively destroys the cluster.This patch changes the deployment manager controller so that in that case it will check the
preserveOnDelete
field and if it istrue
it will delete the correspondingAgent
objects. The result of that is that the hosts will go back to the pool, but marked the will still be marked as provisioned and they will not be provisioned again, thus avoiding the destruction of the cluster.Note that the
BareMetalHosts
will not be removed, but they will stay detached.Related: https://issues.redhat.com/browse/MGMT-17893
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Tested manually with MCE 2.5.4, replacing the assisted service image with a modified one containing this change.
Checklist
docs
, README, etc)Reviewers Checklist