Skip to content

refactor: move AKS Machine provisioning state constants to consts module#1503

Merged
comtalyst merged 2 commits intomainfrom
comtalyst/aks-machine-provisioning-consts
Mar 12, 2026
Merged

refactor: move AKS Machine provisioning state constants to consts module#1503
comtalyst merged 2 commits intomainfrom
comtalyst/aks-machine-provisioning-consts

Conversation

@comtalyst
Copy link
Copy Markdown
Collaborator

@comtalyst comtalyst commented Mar 8, 2026

Description

Move AKS Machine provisioning state string literals to shared constants in pkg/consts/consts.go. The Azure SDK's Machine.Properties.ProvisioningState is typed as *string with no typed constants, so we define our own (ProvisioningStateCreating, ProvisioningStateUpdating, ProvisioningStateSucceeded, ProvisioningStateFailed, ProvisioningStateDeleting).

Replaces scattered string literals across aksmachineinstance.go, aksmachineinstanceutils.go, fake/aksmachinesapi.go, and test helpers. Extracted from PR #1453 per reviewer request to keep PRs single-intention. PR #1453 (GET-based poller) is rebased on top of this.

How was this change tested?

  • go build ./... passes
  • go test ./pkg/fake/... ./pkg/providers/instance/... all pass
  • go vet ./... passes (pre-existing issue in hack/code only)

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note

NONE

comtalyst and others added 2 commits March 7, 2026 19:42
Move ProvisioningState constants (Creating, Updating, Succeeded, Failed,
Deleting) from string literals scattered across the codebase to
pkg/consts/consts.go. This makes them shared and importable by any
package, following existing codebase convention.

Updated usages in: aksmachineinstance.go, aksmachineinstanceutils.go,
aksmachineinstanceutils_test.go, fake/aksmachinesapi.go,
test/aksagentpools.go, test/aksmachines.go.

The VirtualMachine "Deleting" check in pkg/utils/utils.go is left as-is
since it operates on armcompute.VirtualMachine, a different resource type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@comtalyst comtalyst merged commit af1cf66 into main Mar 12, 2026
15 checks passed
@comtalyst comtalyst deleted the comtalyst/aks-machine-provisioning-consts branch March 12, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants