Introduce IsAlpha() and IsBeta() helper methods on field.Error to
encapsulate stability level checks. Unexport the underlying
ValidationStabilityLevel constants to keep the API surface minimal.
Update the apiserver's validation logic to use these helpers.
- Update resttest and genericregistrytest to support RequestInfo injection.
- Inject RequestInfo in Workload storage and strategy tests to resolve context-related failures.
- Refine validate.go log messages and error deduplication logic.
- Test scenarios: Beta Enabled, Beta Disabled, and Legacy (emulated 1.35).
- Remove deprecated Takeover gate references and redundant coverage checks.
- Add TODO to remove legacy emulation in 1.39.
- Update documentation to match the new Validation Lifecycle strategy.
Mark Workload v1alpha1 validations as +k8s:alpha(since:"1.35") and
configure the registry strategy to use WithDeclarativeEnforcement().
This transitions the resource to the stability-based validation lifecycle,
where enforcement is determined by tag stability and feature gates.
Includes generated code updates.
- Introduce WithDeclarativeEnforcement to opt-in to the lifecycle model.
- Update ValidateDeclarativelyWithMigrationChecks to:
- Enforce Beta-level validations when DeclarativeValidationBeta is enabled.
- Shadow Alpha-level validations.
- Filter handwritten errors only for Beta-level validations (when enabled).
- Limit mismatch checking to Alpha and Beta stages when enforcement is enabled.
- Deprecate WithDeclarativeNative and DeclarativeNative field in field.Error.
- Add comprehensive lifecycle tests and clean up redundant test cases.
This change introduces the DeclarativeValidationBeta feature gate in v1.36
as the global safety switch for Beta-stage validation rules and marks
DeclarativeValidationTakeover as deprecated.
Following KEP-5073.
NewSimpleClientset was marked as deprecated when NewClientset was
introduced. This has caused some confusion:
- Not all packages have NewClientset (https://github.com/kubernetes/kubernetes/issues/135980).
- Tests that work with NewSimpleClientset fail when
switched to NewClientset (https://github.com/kubernetes/kubernetes/issues/136327)
because of missing CRD support (https://github.com/kubernetes/kubernetes/issues/126850).
It doesn't seem burdensome to keep NewSimpleClientset around forever. Some unit
tests may even prefer to use it when they don't need server-side apply (less
overhead). Therefore there is no need to deprecate it.
This avoids churn in the eco system because contributors no longer create PRs
"because the linter complains about the usage of a deprecated function".
The len(endpoints) == 0 check is now redundant since the hasReadyEndpoints
check handles this case when the slice is empty, the loop executes zero
times, hasReadyEndpoints stays false, and returns "" via the same path.
When all endpoints are non-ready (ready=false, serving=false, terminating=false),
the topologyModeFromHints function was incorrectly logging "Ignoring same-zone
topology hints for service since no hints were provided for zone" because the
boolean flags remained at their initial values after the loop skipped all
non-ready endpoints.
This fix adds tracking for whether any ready endpoints were processed and
returns early if none exist, avoiding misleading log messages.
Also adds a test case covering this scenario.
Both repositories are archived on GitHub and were detected by the
new check-dependency-archived-periodical CI job.
Also add flynn/go-shlex to unwantedReferences (referenced by
github.com/coredns/caddy).
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
fix: Update TestAuditLogMaxSizeZero to expect os.File when MaxSize is 0
fix: Update TestAuditValidOptions to handle MaxSize=0 case