machineops: add provider lifecycle registration#459
Open
imiller31 wants to merge 1 commit into
Open
Conversation
7d45d02 to
77fb466
Compare
f390bdc to
e719e37
Compare
e719e37 to
d62167c
Compare
jveski
approved these changes
Jul 14, 2026
bcho
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
controller.AddToManagerso provider controllers register with controller-runtime without constructing the internal reconcilerstatus.targets[], use the current Machine provider ID for callbacks, and serialize host operations by MachineProvider authoring shape
Registered operations replace
Supportsand optional interface type assertions. The controller owns status transitions, credential resolution, retries, polling, per-Machine conflict serialization, and terminalization.Long-running
Begincallbacks must be idempotent for the stableOperationRequest.OperationUID. The controller may invokeBeginagain until the returned operation handle has been persisted. Providers return ordinary errors for retryable failures andPermanentErrorwhen retrying cannot make progress.Safety properties
MachineOperationUID supplies correlation across both Begin retries and Poll callsMachine.spec.providerIDBegincallback with the same operation UIDBegin;PermanentErrorterminalizes the operationPermanentErrorterminalizes the operationReplaySafe()Review follow-ups
InProgresswhen an immediate operation has an unknown outcome so the request is not replayedValidation
go generate ./api/machina/v1alpha3go test ./api/machina/v1alpha3 ./pkg/machineops/... ./internal/machineops/... ./cmd/machine-ops-controller -count=1go test -race ./pkg/machineops ./pkg/machineops/controller ./internal/machineops ./internal/machineops/providers/azurevm ./internal/machineops/providers/ociinstance ./cmd/machine-ops-controller -count=1go vet ./pkg/machineops/... ./internal/machineops/... ./cmd/machine-ops-controller/...golangci-lint runUnrelated repository test failure
go test ./...reaches the existing deterministicTestMaterializeEmbeddedFSfailure: the test expects01-namespace.yaml, which is not materialized in its temporary directory. The failure does not involve MachineOperation code.