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-17893: Don't destroy cluster on detach #6532

Commits on Jul 9, 2024

  1. MGMT-17893: Don't destroy cluster on detach

    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>
    jhernand committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    3ee8313 View commit details
    Browse the repository at this point in the history