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

🐛 Make custom deploy equivalent to image deploy #2048

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zaneb
Copy link
Member

@zaneb zaneb commented Nov 10, 2024

If we have to recreate the provisioner's state during deprovisioning, we must
first call Adopt() to ensure that something will actually happen to deprovision it.
This is the case regardless of provisioning method, but previously only
happened when an image was provisioned. In practice, the ironic provisioner
was attempting to adopt in cases where it was not originally intended to, and
subsequent changes mean it is never necessary.

If an externally provisioned host has a provisioning image set and then
the externallyProvisioned flag is removed, we should not begin an inspection
(which would involve rebooting the host), but instead move directly to
the provisioned state. This is also the case regardless of
provisioning method, but previously only happened when an image was
provisioned.

@zaneb
Copy link
Member Author

zaneb commented Nov 10, 2024

/cc @dtantsur

Copy link
Member Author

@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.

/hold

@metal3-io-bot metal3-io-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 10, 2024
@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 10, 2024
Since c0373bb we always set the
instance_info in ValidateManagementAccess() whether or not we are
re-registering a fresh node, so the code to check whether the node has
been re-registered or is transitioning from a clean failure is not
accurate; we have always been adopting when there is an image URL
available, even after a cleaning failed and the node has always existed.
For this code to have had its original effect, we would have to limit
the setting of the instance_info to the Enroll state in
ValidateManagementAccess().

However, since d78fb4d we always move
the state back to available during deprovisioning, so adopting during
deprovisioning is not needed anyway. The Deprovision() function will
always clean the node.

Therefore, never adopt in Adopt() during deprovisioning, allow
Deprovision() to do the cleaning in both cases.

Signed-off-by: Zane Bitter <[email protected]>
This change ensures that custom deploy methods behave comparably to
image deploys in respect of calling the provisioner's Adopt method.

In practice, the ironic provisioner does not take any action during
Adopt() when the state is deprovisioning, but conceptually it is up to
the provisioner to decide that regardless of the deploy mode.

Signed-off-by: Zane Bitter <[email protected]>
If an externally provisioned host has a provisioning image set and then
the externallyProvisioned flag is removed, we do not begin an inspection
(which would involve rebooting the host), but instead move directly to
the provisioned state.

This change ensures that the same behaviour occurs when the host has a
custom deploy method set, since this should be equivalent to an image
deploy.

Signed-off-by: Zane Bitter <[email protected]>
@zaneb
Copy link
Member Author

zaneb commented Nov 11, 2024

/hold cancel

@metal3-io-bot metal3-io-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 11, 2024
@tuminoid
Copy link
Member

/retest

@tuminoid
Copy link
Member

It seems Prow is having issues. Failures are non PR related.

@dtantsur
Copy link
Member

/approve

Looks valid to me.

@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 Nov 11, 2024
@dtantsur
Copy link
Member

/test generate
/test gomod
/test manifestlint

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. 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.

4 participants