The last dependency pulling in the tips of go-difflib and go-spew has
reverted to the last release of both projects, so k/k can revert to
the releases too. As can be seen from the contents of vendor, this
doesn't result in any actual change in the code.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: 3986472b3c7202716f92e586ccfaa4b4fe573dc5
The test relied on a 100ms sleep to ensure that controller was done. If that
race was lost, one goroutine was intentionally prevented from completing by
locking a mutex permanently. A TODO was left about detecting that.
Adding goroutine leak checking in
https://github.com/kubernetes/kubernetes/pull/126387 revealed that this race
indeed sometimes is lost because the goroutine
leaked (https://github.com/kubernetes/kubernetes/issues/129400).
Waiting for controller shutdown instead of relying on timing should fix this.
Kubernetes-commit: 8e1403563a60f3b7a258e3bbb64b5c3a7f6548fb
The methods NewFakeClock were using a testing dependency as a parameter,
to avoid breaking compatibility and to remove this dependency, just use
the clock.Clock interface.
If we have to do it again most probable we have chosen other pattern and
for sure other names, but now is too late.
Kubernetes-commit: 5c283cbb453acac9869b49020f6f999796360729
Only the v1 API should be in use. The v1beta1 API therefore doesn't get updated
and doesn't need the context.TODO anymore.
Kubernetes-commit: f1834f06f4f7de8c6a5a70138cf08f8ca804f5c2
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:
- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.
This commit was generated with
sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')
Everything was included, except for
package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".
Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
Given the ongoing work on generifying client-go, it might make sense
for me to be a reviewer (at least to keep better track of changes
being made before they go in).
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: 3d069b2a8a6a635434331f96b79e44bc7c98f29c
"Real" clients use objectWithMeta to enforce support for meta.Object;
strictly speaking, fakes don't need this, but it's best to align them
with the real clients to ensure that fakes don't end up allowing types
that can't be used with the real clients.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: 736e5560ba6b21247c21f8ed12007e1d6d5fec1a
This adds a generic implementation of a fake clientset, and uses it to
replace the template code in generated fake clientsets for the default
methods. The templates are preserved as-is (or as close as they can
be) for use in extensions, whether for resources or subresources.
Fake clientsets with no extensions are reduced to their main getter,
their specific struct, and their constructor. All method
implementations are provided by the generic implementation. The
dedicated struct is preserved to allow extensions and expansions to be
defined where necessary.
Instead of handling the variants (with/without list, apply) with a
complex sequence of if statements, build up an index into an array
containing the various declarations.
Similarly, instead of calling different action constructors for
namespaced and non-namespaced clientsets, assume the current behaviour
of non-namespaced action creation (equivalent to creating a namespaced
action with an empty namespace) and document that assumption in the
action implementation.
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Kubernetes-commit: b0ce65df9b74d4dc72050840d5ad067596d7b822
KEP-4603: Maintain current 10 minute recovery threshold for container backoff regardless of changes to the maximum duration
Kubernetes-commit: ab30adcbae57fc498cb876979e232b422468af9a