feat(cloudprovider): shared cloud provider helpers and app.Run #25

Merged
mikluko merged 1 commit from cloudprovider into main 2026-11-28 12:38:35 +00:00
Owner

kit/cloudprovider helpers and kit/app (kit-vmr.17), ported from provider-vultr; helpers, not a generic CloudProvider.

  • cloudprovider: RepairPolicies; NodeClass[T] lookup (NotFound → NodeClassNotReady) and RequireReady; CreateError mapping (nodename's ErrInvalidTemplate → NodeClassNotReady, ErrNoFreeName → InsufficientCapacity) with provider reason funcs; Launcher.Launch over offering.Rank candidates, marking a Refused offering unavailable and falling through (MaxAttempts caps tries; 1 keeps vultr's current behaviour); Hydrate; DriftCheck table with FirstDrift; CleanupContext.
  • app: Run(ctx, Setup, ...Option) wires Karpenter core with the provider's CloudProvider and controllers from Setup; returns errors instead of panicking. One Run per process (core registers global metrics).
  • Stays in the provider: cloudprovider.go, instance calls, provider ID and image fields, hash annotations, image eligibility, node naming wiring, token release, config loading and RequireManagedConfig before Run.

🤖 Generated with Claude Code

kit/cloudprovider helpers and kit/app (kit-vmr.17), ported from provider-vultr; helpers, not a generic CloudProvider. - cloudprovider: RepairPolicies; NodeClass[T] lookup (NotFound → NodeClassNotReady) and RequireReady; CreateError mapping (nodename's ErrInvalidTemplate → NodeClassNotReady, ErrNoFreeName → InsufficientCapacity) with provider reason funcs; Launcher.Launch over offering.Rank candidates, marking a Refused offering unavailable and falling through (MaxAttempts caps tries; 1 keeps vultr's current behaviour); Hydrate; DriftCheck table with FirstDrift; CleanupContext. - app: Run(ctx, Setup, ...Option) wires Karpenter core with the provider's CloudProvider and controllers from Setup; returns errors instead of panicking. One Run per process (core registers global metrics). - Stays in the provider: cloudprovider.go, instance calls, provider ID and image fields, hash annotations, image eligibility, node naming wiring, token release, config loading and RequireManagedConfig before Run. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat: cloudprovider helpers and app.Run
Some checks failed
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 1s
CI / check (pull_request) Failing after 7s
CI / ci (pull_request) Failing after 0s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 11s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
6750b5d9de
Helpers, not a generic CloudProvider: each provider keeps its own
cloudprovider.go and calls these.

Launcher defaults to trying every candidate; a provider whose spec allows
one create attempt per Create (hetzner CP-20) sets MaxAttempts to 1.

app.Run registers controllers and starts the manager itself rather than
through Operator.WithControllers and Start, which panic on error.

Assisted-By: Claude <noreply@anthropic.com>
fix(app,cloudprovider): review nits on #25
All checks were successful
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 2s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 16s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Successful in 1m37s
CI / ci (pull_request) Successful in 0s
f8f0afd500
Run also returns a panic in setup, in building the core controllers and
in Register as an error, so a second Run in a process fails rather than
panics. The operator's context keeps the caller's cancellation but not
its values: context cannot merge two parents' values, and the
operator's carry Karpenter's options.

Refused(nil) is nil; RequireReady of a nil node class is NodeClassNotReady.
Launch and FirstDrift state that adoption and the hash drift check are
the provider's.

The vendorHash of the previous commit was computed while app/ and
cloudprovider/ were untracked, which the flake's fileset leaves out.

Assisted-By: Claude <noreply@anthropic.com>
mikluko force-pushed cloudprovider from f8f0afd500
All checks were successful
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 2s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 16s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Successful in 1m37s
CI / ci (pull_request) Successful in 0s
to d59156fabd
All checks were successful
CI / verify (pull_request) Has been skipped
CI / changelog (pull_request) Successful in 2s
Vulnerabilities / govulncheck-1 (pull_request) Successful in 12s
Vulnerabilities / govulncheck (pull_request) Successful in 0s
CI / check (pull_request) Successful in 1m33s
CI / ci (pull_request) Successful in 0s
CI / verify (push) Has been skipped
CI / changelog (push) Has been skipped
CI / check (push) Successful in 5s
CI / ci (push) Successful in 0s
Vulnerabilities / govulncheck-1 (push) Successful in 27s
Vulnerabilities / govulncheck (push) Successful in 0s
2026-11-28 12:36:57 +00:00
Compare
mikluko deleted branch cloudprovider 2026-11-28 12:38:35 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
karpenter/kit!25
No description provided.