Skip to content

Add Fleet machine lifecycle API foundation - #19

Open
scotwells wants to merge 1 commit into
mainfrom
codex/fleet-api-foundation
Open

scotwells wants to merge 1 commit into
mainfrom
codex/fleet-api-foundation

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Summary

  • establish go.datum.net/fleet as the Go module
  • add the five provisional public machine-lifecycle API types and scheme registration
  • add matching CRDs, status subresources, immutability checks, defaults, and kubectl printer columns
  • add focused CI for API compilation, CRD rendering, and documentation-link validation
  • update the proposal status without claiming controller or provider behavior

Review boundaries

This is PR 1 of the implementation stack and is based on #2. It intentionally contains no allocator, simulator, controller, provider integration, Milo integration, or deployment.

The primary review questions are public resource shape, identity boundaries, validation/defaulting, status projection, and module/package conventions.

Validation

  • go test ./internal/api/...
  • kustomize build config/base/crd
  • ./hack/validate-doc-links.sh
  • git diff --check HEAD^ HEAD

All commands passed from a detached worktree containing only this commit.

@scotwells
scotwells requested review from ecv and kevwilliams November 4, 2026 00:59
@scotwells
scotwells changed the base branch from docs/first-machine-lifecycle-milestone to main November 4, 2026 00:59

@ecv ecv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve.

Go types and CRDs line up, and CI is green. I ran all five CRDs through the apiextensions validator (v0.36.1), including CEL cost estimation, with zero errors. Every default satisfies its own rules.

  • Checked the CEL: the MachineClass mode and source immutability rule, Machine provider and device immutability, MachineClaim allocation-input immutability and Installation's self == oldSelf plus predecessor rule. The Disabled, Off, [IPv6] and Delete defaults are all in their enums, and the immutability comparisons hold across defaulted fields.

Follow-ups:

  • MachineClass profilePolicy, access and capacity, and MachineProfile cores, gpus, disks and interfaces are x-kubernetes-preserve-unknown-fields. The Go types require capacity.machines.namespace, allowedProfiles[].name and gpus.count, but the API server enforces none of it, so typos and missing fields are admitted. Spell out the schema before controllers rely on these.
  • Constraint and QuantityConstraint have no CEL for min <= max or for exact excluding min/max. Quantity strings are unvalidated.
  • MachineClaim ref names (machineClassRef, machineProfileRef, locationRef) and Installation claimRef/imageRef lack minLength: 1, unlike the Machine refs. networkInterfaces has no maxItems.
  • Machine.reclaimPolicy is required with a single-value enum and no default. Consider defaulting it to Retain.
  • deepCopy round-trips through JSON and ignores errors. Replace it with generated deepcopy before controllers use these types.

@ecv
ecv requested a review from andrewb3000 November 5, 2026 04:25
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.

3 participants