Skip to content

feat(quota): add Feature to ResourceRegistration type enum #575

@kevwilliams

Description

@kevwilliams

Summary

Add `Feature` as a valid value for `spec.type` on `ResourceRegistration`. This is a hard prerequisite for the feature flagging system — `spec.type` is immutable after creation, so this must land before any feature flag registrations are created.

Changes required

`pkg/apis/quota/v1alpha1/resourceregistration_types.go`

Change the enum marker on line 61:
```go
// before
// +kubebuilder:validation:Enum=Entity;Allocation

// after
// +kubebuilder:validation:Enum=Entity;Allocation;Feature
```

Update the comment block above to describe `Feature`: a boolean entitlement grant with no admission enforcement or claim machinery — used for org-level feature flags.

Re-run code generation
```bash
make generate
```
This regenerates `config/crd/bases/quota/quota.miloapis.com_resourceregistrations.yaml`.

Add Chainsaw test in `test/quota/registration-validation/`:

  • New fixture `test-data/valid-feature-registration.yaml` — mirrors `valid-registration.yaml` with `type: Feature`
  • New step in `chainsaw-test.yaml` verifying `type=Feature` is accepted and reaches `Active=True`

Context

Enhancement: datum-cloud/enhancements#695
No controller logic branches on `spec.type` — this is a validation-only change.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgoPull requests that update go code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions