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

🐛 allow namespace to continue terminating when bmh is deprovisioning at the same time #1226

Merged
merged 1 commit into from Feb 27, 2023

Conversation

pixelsoccupied
Copy link
Contributor

What this PR does / why we need it:
When BMH is deleted and NS is also in terminating state around the same time (usually GitOps/ArgoCD is involved), BMO may not be able to creating additional CRs as part of the deprovisioning steps. This condition essentially hangs the cleanup of BMH, its Secret (used for BMC) while the NS stays at a terminating state.

As long as registerHost is handling errors during this time, the issue goes away.

/cc @dtantsur
/cc @rhjanders
/cc @zaneb

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@metal3-io-bot metal3-io-bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 21, 2023
@metal3-io-bot
Copy link
Contributor

Hi @pixelsoccupied. Thanks for your PR.

I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 21, 2023
@zaneb
Copy link
Member

zaneb commented Feb 22, 2023

/ok-to-test

@metal3-io-bot metal3-io-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 22, 2023
@mboukhalfa
Copy link
Member

/test-centos-integration-e2e-main

…he same time

print ns to easier tracing

allow namespace to continue with terminating when deprovisioning at the same time
Copy link
Member

@zaneb zaneb left a comment

Choose a reason for hiding this comment

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

/lgtm

// No need to create PreprovisioningImage if host is not yet registered
// or is externally provisioned
preprovImgFormats = nil
case metal3v1alpha1.StateDeprovisioning:
// PreprovisioningImage is not required for deprovisioning when cleaning is disabled
if info.host.Spec.AutomatedCleaningMode == metal3v1alpha1.CleaningModeDisabled {
Copy link
Member

Choose a reason for hiding this comment

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

I don't love that we're encoding an assumption about the implementation of Ironic (i.e. that it doesn't need a PreprovisioningImage when cleaning is disabled) into the controller (rather than the ironic provisioner), but the alternative of passing the state and cleaning mode to PreprovisioningImageFormats() doesn't make a lot of conceptual sense either, so I think this is probably the best hack for now.

Copy link
Member

Choose a reason for hiding this comment

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

I'm afraid we already have way too many assumptions about Ironic baked everywhere, including the API.

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Feb 26, 2023
@zaneb
Copy link
Member

zaneb commented Feb 26, 2023

/test-centos-integration-e2e-main
/test-ubuntu-integration-main

@dtantsur
Copy link
Member

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dtantsur

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2023
@metal3-io-bot metal3-io-bot merged commit 3ad3e67 into metal3-io:main Feb 27, 2023
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants