The generator declared every +k8s:update error as field.Invalid at the
field path, but the runtime emits field.Forbidden at index/key paths
for NoAddItem and NoRemoveItem. Declarative-validation coverage tests
fail on fields using these constraints with uncovered-rule errors.
Promote FunctionGen.Emits to a slice so a single call can declare
multiple (ErrorType, PathFragment) tuples, and have the update validator
declare the actual emissions for each constraint.
This allows us to drop direct yaml.Unmarshal invocation and replace it
with proper kuberc.LoadPreference invocations which rely on our
conversion mechanisms.
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
* Clean unnecessary event references in watch cache interval buffer in time
If this is not done, event if some watch events are aged out from the
watch cache, they will not be GCed during the lifetime of the watcher
that holds references to these events in the watch cache interval
* Add code comment
Fixes ci-kubernetes-e2e-kind-golang-tip and ci-kubernetes-unit-golang-tip,
which started failing under Go tip identifying as go1.27 with:
vendor/google.golang.org/grpc/internal/transport/handler_server.go:271:18:
undefined: http2.TrailerPrefix
In x/net v0.54.0, TrailerPrefix was defined only in http2/server.go, which
carries `//go:build !(go1.27 && !http2legacy)` and is therefore excluded
under go1.27. Upstream golang/net commit 1efab4271a moved TrailerPrefix
(and other symbols accidentally dropped by the go1.27 server wrapper) into
common files. That fix is released in v0.55.0.
Tracked in https://github.com/kubernetes/kubernetes/issues/139257
* kubectl: filter top pod metrics using pod field selectors
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
* test case added
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
* strict condition added for filtering
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
---------
Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
Cover *Struct, []string, and map[string]string with non-zero defaults
in the nonzero_defaults package. Each previously failed code generation
and now emits the expected RequiredPointer/RequiredSlice/RequiredMap
validator.
hasZeroDefault failed with "unknown zero-value for type X" when +default
was used on fields whose underlying type wasn't in typeZeroValue (e.g.
structs, slice/map element types). For nilable types the caller ignores
zeroDefault and always treats the field as required, so return early
instead of looking up a value that won't be used.
Deprecated and non-operational since 1.36. Locking prevents users from
setting the gate; removal can follow in 1.39 per the compatibility
lifecycle check.