Skip to content

feat: add UpdateMachine method to Driver interface for in-place node updates - #1191

Open
valeryia-hurynovich wants to merge 1 commit into
gardener:masterfrom
valeryia-hurynovich:driver-mcm-update-machine-interface
Open

valeryia-hurynovich wants to merge 1 commit into
gardener:masterfrom
valeryia-hurynovich:driver-mcm-update-machine-interface

Conversation

@valeryia-hurynovich

Copy link
Copy Markdown

What this PR does / why we need it:
Extend the Driver interface with an UpdateMachine method that providers can implement to update underlying infrastructure resources (e.g. a ServerClaim image) after a successful in-place node OS update.

MCM transfers Machine ownership to a new MachineSet after in-place update completes, patching Machine.spec.class.name to the new MachineClass. However, no existing driver method is called at that point, so providers have no hook to react to the MachineClass change.

The new UpdateMachine method fills this gap:

  • Called from reconcileClusterMachine (triggerUpdateFlow) when the Machine carries the LabelKeyNodeUpdateResult=successful label that the deployment controller sets during ownership transfer.
  • Receives the Machine and the already-resolved new MachineClass.
  • Providers that do not support in-place VM updates should return codes.Unimplemented; triggerUpdateFlow handles this gracefully.
  • FakeDriver returns codes.Unimplemented (safe default for existing providers).

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
This PR extends the Driver interface with an UpdateMachine method to allow providers to update underlying infrastructure resources after a successful in-place node OS update.

Release note:

Add `UpdateMachine` method to the `Driver` interface to allow providers to update infrastructure resources after a successful in-place node update. Existing provider implementations must add this method; returning `codes.Unimplemented` is sufficient for providers that do not support in-place VM updates.

@valeryia-hurynovich
valeryia-hurynovich requested a review from a team as a code owner November 13, 2026 11:37
@gardener-prow

gardener-prow Bot commented Nov 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ashwani2k for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@gardener-prow gardener-prow Bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 13, 2026
@gardener-prow

gardener-prow Bot commented Nov 13, 2026

Copy link
Copy Markdown

Welcome @valeryia-hurynovich!

It looks like this is your first PR to gardener/machine-controller-manager 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if gardener/machine-controller-manager has its own contribution guidelines.

Thank you, and welcome to Gardener. 😃

@gardener-prow gardener-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 13, 2026
@gardener-prow

gardener-prow Bot commented Nov 13, 2026

Copy link
Copy Markdown

Hi @valeryia-hurynovich. Thanks for your PR.

I'm waiting for a gardener 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.

Details

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.

@gardener-prow gardener-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 13, 2026
…updates

Extend the Driver interface with an UpdateMachine method that providers
can implement to update underlying infrastructure resources (e.g. a
ServerClaim image) after a successful in-place node OS update.

MCM transfers Machine ownership to a new MachineSet after in-place
update completes, patching Machine.spec.class.name to the new
MachineClass. However, no existing driver method is called at that
point, so providers have no hook to react to the MachineClass change.

The new UpdateMachine method fills this gap:
- Called from reconcileClusterMachine (triggerUpdateFlow) when the
  Machine carries the LabelKeyNodeUpdateResult=successful label that
  the deployment controller sets during ownership transfer.
- Receives the Machine and the already-resolved new MachineClass.
- Providers that do not support in-place VM updates should return
  codes.Unimplemented; triggerUpdateFlow handles this gracefully.
- FakeDriver returns codes.Unimplemented (safe default for existing
  providers).

Signed-off-by: valeryia-hurynovich <v.hurynovich@sap.com>
@valeryia-hurynovich
valeryia-hurynovich force-pushed the driver-mcm-update-machine-interface branch from 30a1121 to 13d47be Compare November 13, 2026 11:52
@gardener-prow gardener-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant