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

[release-ocm-2.11] MGMT-18370: Don't destroy cluster on detach #6556

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #6532

/assign jhernand

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>
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 10, 2024

@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: MGMT-17893

In response to this:

This is an automated cherry-pick of #6532

/assign jhernand

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.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 10, 2024
@openshift-ci openshift-ci bot requested review from danmanor and gamli75 July 10, 2024 10:25
@jhernand
Copy link
Contributor

jhernand commented Jul 10, 2024

/retitle [release-ocm-2.11] MGMT-18370: Don't destroy cluster on detach

@openshift-ci openshift-ci bot changed the title [release-ocm-2.11] MGMT-17893: Don't destroy cluster on detach [release-ocm-2.11] MGMT-18370: Don't destroy cluster on detach Jul 10, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 10, 2024
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 10, 2024

@openshift-cherrypick-robot: This pull request references MGMT-18370 which is a valid jira issue.

In response to this:

This is an automated cherry-pick of #6532

/assign jhernand

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.

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 68.46%. Comparing base (11cacec) to head (eb47556).
Report is 1 commits behind head on release-ocm-2.11.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-ocm-2.11    #6556   +/-   ##
=================================================
  Coverage             68.45%   68.46%           
=================================================
  Files                   247      247           
  Lines                 36252    36261    +9     
=================================================
+ Hits                  24818    24827    +9     
  Misses                 9235     9235           
  Partials               2199     2199           
Files Coverage Δ
...oller/controllers/clusterdeployments_controller.go 71.86% <53.33%> (-0.17%) ⬇️

... and 3 files with indirect coverage changes

@gamli75
Copy link
Contributor

gamli75 commented Jul 10, 2024

/retest-required

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 10, 2024
Copy link

openshift-ci bot commented Jul 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gamli75, openshift-cherrypick-robot

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 11cacec and 2 for PR HEAD eb47556 in total

@jhernand
Copy link
Contributor

/retest

1 similar comment
@jhernand
Copy link
Contributor

/retest

Copy link

openshift-ci bot commented Jul 12, 2024

@openshift-cherrypick-robot: 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.

@openshift-merge-bot openshift-merge-bot bot merged commit 7aca935 into openshift:release-ocm-2.11 Jul 12, 2024
14 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants