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

🐛 Proceed to power off after deprovisioning #1312

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

honza
Copy link
Member

@honza honza commented Jul 14, 2023

Follow up to #1176

@honza honza changed the title Proceed to power off after deprovisioning 🐛 Proceed to power off after deprovisioning Jul 14, 2023
@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 14, 2023
@zhouhao3
Copy link
Member

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

@elfosardo
Copy link
Member

/lgtm

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

/lgtm

@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2023
@dtantsur
Copy link
Member

dtantsur commented Aug 9, 2023

/lgtm

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

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

@kashifest
Copy link
Member

Can this change be reflected back also in the state diagram https://github.com/metal3-io/baremetal-operator/blob/main/docs/BaremetalHost_ProvisioningState.png ? We are planning for a minor release of BMO soon, can we take this bug fix in before that @honza @zaneb

@metal3-io-bot metal3-io-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2023
@honza
Copy link
Member Author

honza commented Aug 25, 2023

Good catch! I updated the diagram, please have a look.

controllers/metal3.io/host_state_machine.go Outdated Show resolved Hide resolved
@@ -51,11 +51,13 @@ digraph BaremetalHost {
Provisioned -> Deprovisioning [label="!DeletionTimestamp.IsZero()"]

ExternallyProvisioned [shape=doublecircle]
ExternallyProvisioned -> Deleting [label="!DeletionTimestamp.IsZero()"]
ExternallyProvisioned -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
Copy link
Member

Choose a reason for hiding this comment

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

People have complained about all the Deleting3 [shape=point] stuff making it unclear that the host goes into the Deleting state no matter where it was when deleted.
I wonder if this is the point where it finally becomes completely untenable to hide this info for the sake of saving a few lines on the diagram. How bad does it look if we include all the edges?

Copy link
Member Author

Choose a reason for hiding this comment

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

Something like this:

BaremetalHost_ProvisioningState

Copy link
Member

Choose a reason for hiding this comment

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

🤔 that's... not outstanding, but maybe not so bad that it's worth the ongoing confusion to avoid it. WDYT?
We don't actually go to PoweringOffBeforeDelete from Unmanaged or Registering, do we?

Copy link
Member

Choose a reason for hiding this comment

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

We don't actually go to PoweringOffBeforeDelete from Unmanaged or Registering, do we?

We actually do, but the (inevitable) error is handled, so I guess not technically a bug even though it is a bit messy for the user.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I pushed the diagram changes. I think it's reasonably clear.

@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 14, 2023
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.

/approve

Registering -> Deleting2 [label="!DeletionTimestamp.IsZero()"]

Deleting2 [shape=point]
Registering -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]

ExternallyProvisioned -> Inspecting [label="!externallyProvisioned && NeedsHardwareInspection()"]
Copy link
Member

Choose a reason for hiding this comment

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

I just discovered that if we change all these ones with && or || to e.g.

Suggested change
ExternallyProvisioned -> Inspecting [label="!externallyProvisioned && NeedsHardwareInspection()"]
ExternallyProvisioned -> Inspecting [label="!externallyProvisioned &&\nNeedsHardwareInspection()"]

it makes everything a bit more compact, and this one in particular fixes that diabolical intersection of the two edges at the top right.

Copy link
Member Author

Choose a reason for hiding this comment

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

Like this?

BaremetalHost_ProvisioningState

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zaneb

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 Sep 14, 2023
@metal3-io-bot metal3-io-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 14, 2023
@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 14, 2023
@metal3-io-bot metal3-io-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 14, 2023
@zaneb
Copy link
Member

zaneb commented Sep 14, 2023

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

@dtantsur
Copy link
Member

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

Unmanaged -> Deleting1 [label="!DeletionTimestamp.IsZero()"]

Deleting1 [shape=point]
Unmanaged -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
Copy link
Member

Choose a reason for hiding this comment

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

This make me worried. Unmanaged hosts cannot be powered off. Isn't it the cause of the issue that we've recently discussed?

Copy link
Member Author

Choose a reason for hiding this comment

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

We already have a follow up for this here #1356

Registering -> Deleting2 [label="!DeletionTimestamp.IsZero()"]

Deleting2 [shape=point]
Registering -> PoweringOffBeforeDelete [label="!DeletionTimestamp.IsZero()"]
Copy link
Member

Choose a reason for hiding this comment

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

Same

Copy link
Member Author

Choose a reason for hiding this comment

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

We already have a follow up for this here #1356

@dtantsur
Copy link
Member

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2023
@metal3-io-bot metal3-io-bot merged commit ca4f58f into metal3-io:main Sep 15, 2023
10 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. 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.

7 participants