- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh
Replay of a9593d634c6a053848413e600dadbf974627515f
Kubernetes-commit: 15d9d196476d64482189f00f1cf1a2061aea5b35
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:
- Logging a message only above a certain verbosity threshold without
recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
this matters when using a logging backend which records the verbosity
level.
- Passing a format string with parameters to a logging function that
doesn't do string formatting.
All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.
In some cases it reports false positives, but those can be suppressed with
source code comments.
Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:
if klog.V(5).Enabled() {
klog.Info("hello world")
}
Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.
Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
Kubernetes-commit: 9eaa2dc554e0c3d4485d4c916dfdbc2f517db2e0
Implements server side field validation behind the
`ServerSideFieldValidation` feature gate. With the
feature enabled, any create/update/patch request
with the `fieldValidation` query param set to
"Strict" will error if the object in the request
body have unknown fields. A value of "Warn"
(also the default when the feautre is enabled)
will succeed the request with a warning.
When the feature is disabled (or the query param
has a value of "Ignore"), the request will succeed
as it previously had with no indications of any
unknown or duplicate fields.
Kubernetes-commit: e50e2bbc889eb274ad1463a54188a2805767bfde
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.
Kubernetes-commit: 85bcd243aa3c8769a5904a1aea44ce704f5e7174
If one doesn't DeepCopy() on the way into Create, we can end up writing
into the original object. This is by design, and should not be a
problem EXCEPT for tests. If a test compares the input to this function
with the result, but the input was mutated in-situ, it may hide errors,
resulting in tests that pass, but shouldn't.
Kubernetes-commit: 6dfae64d9bebb2c40680bbd6e8270f69839ab013
Adds and implements ResetFieldsProvder interface in order to ensure that
the fieldmanager no longer owns fields that get reset before the object
is persisted.
Co-authored-by: Kevin Wiesmueller <kwiesmul@redhat.com>
Co-authored-by: Kevin Delgado <kevindelgado@google.com>
Kubernetes-commit: a1fac8cbd9289d95db4831a83239292ed56ce59d
All of the After* hooks are called, whether the operation is dry-run or
not. Create and Upate both have BeginCreate() hooks which know about
dry-run but delete doesn't, and can't (because of graceful deletion and
finalizers, the Delete() method may return and the object is actually
deleted later).
This adds an argument to AfterDelete(), and the others will follow.
This commit also adds tests for AfterDelete being called in the right
places.
Kubernetes-commit: 9402f48e050c25514a95da2e5e1feb6754ad0e0d
These hooks return a "cleanup" func which is called when the top-level
operation completes, with an indicator of which result.
This is to enable much simpler handling of allocations in Service's REST
implementation, in particular.
Some discussion in https://github.com/kubernetes/kubernetes/pull/95967
This also adds tests for the almost totally untested Decorator,
AfterCreate, and AfterUpdate hooks.
Kubernetes-commit: 67c9761623052d147a58807caced1c89262fe30d