Awesome Reviewers

When evolving an API with new fields, treat defaulting/mirroring and declarative validation as a coupled compatibility problem.

1) Mirror/default fields must preserve client intent

2) Declarative validation migration: only remove manual checks when it’s truly equivalent

Practical pattern

Illustrative (constraint kept manual when DV can’t represent the mutual exclusion)

// Exactly one of Value or ValueFrom must be specified.
// TODO: DV migration blocked by current API shape (non-nilable/union tag limitations).
func validateCounter(c *ConsumeCounter, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if c.Value == (resource.Quantity{}) == (c.ValueFrom == nil) {
		allErrs = append(allErrs, field.Invalid(fldPath, c,
			"exactly one of value or valueFrom must be specified"))
	}
	return allErrs
}

Result: API additions remain patch-compatible across client versions, and constraints don’t silently change semantics during DV migration.