Compare commits

..

123 Commits

Author SHA1 Message Date
Kubernetes Publisher
ef61656b8a Update dependencies to v0.31.0-alpha.2 tag 2024-06-18 18:10:49 +00:00
Kubernetes Publisher
d2f5fba1f8 Merge pull request #125528 from seans3/port-forward-beta
PortForward over Websockets Graduates to Beta

Kubernetes-commit: ef9965ebc66dafda37800bb04f5e284535bbba10
2024-06-16 13:59:32 -07:00
Sean Sullivan
6e4469285c Graduate PortForwardWebsockets to Beta
Kubernetes-commit: 3ae3b4ea551443d8ef695d31bf0c51963fe35ac3
2024-06-15 16:09:23 -07:00
Kubernetes Publisher
cea15394b3 Merge pull request #124509 from p0lyn0mial/upstream-watch-list-code-gen
client-go: add support for API streaming

Kubernetes-commit: 6ac60160c5729ade462b041b170ec8ac0f1eb3bc
2024-06-14 14:10:49 +00:00
Kubernetes Publisher
e4e31fd32c Merge pull request #125472 from karlkfi/karl-watch-comments
Add details to watch interface method comments

Kubernetes-commit: b498eb97406f780fbbeb39204f50bc473e64af56
2024-06-13 14:10:58 +00:00
Kubernetes Publisher
5f43af464b Merge pull request #125391 from karlkfi/karl-reflector-watch-stop
Refactor Reflector ListAndWatch

Kubernetes-commit: 08a8480558c7ace68a6ac3de10a21f8c02663077
2024-06-13 14:10:56 +00:00
Lukasz Szaszkiewicz
cc198ea39d make update
Kubernetes-commit: f62c80f965934eeeb2e028497bede7bcc632995d
2024-06-13 10:25:56 +02:00
Kubernetes Publisher
39cc8deb07 Merge pull request #125435 from p0lyn0mial/upstream-rm-reflector-data-consistency-detector-test
client-go/reflector: remove reflector_data_consistency_detector_test.go

Kubernetes-commit: 8db1402f3db163af73e54f1b4932ddf9971eb68e
2024-06-12 22:10:48 +00:00
Karl Isenberg
f29a36dfab Refactor Reflector ListAndWatch
- Extract watchWithResync to simplify ListAndWatch
- Wrap watchHandler with two variants, one for WatchList and one for
  just Watch.
- Replace a bool pointer arg with a bool arg and bool return, to
  improve readability.
- Use errors.Is to satisfy the linter
- Use %w to wrap the store.Replace error, to allow unwrapping.

Kubernetes-commit: 65fc1bb463c85a4c85e619bf7acac9503e23a253
2024-06-12 13:14:55 -07:00
Karl Isenberg
48d8fc7e2e Add details to watch interface method comments
The watch.Interface design is hard to change, because it would break
most client-go users that perform watches. So instead of changing the
interface to be more user friendly, this change updates the method
comments to explain the different responsibilities of the consumer
(client user) and the producer (interface implementer).

Kubernetes-commit: 1f35231a1d4f7b8586a7ec589c799729eeb4f7c4
2024-06-12 13:06:22 -07:00
Kubernetes Publisher
fb1003a7e4 Merge pull request #125440 from p0lyn0mial/upstream-client-go-watchlist-can-use-watchlist-for-list-rq
client-go/util/watchlist: intro CanUseWatchListForListRequest(

Kubernetes-commit: 813d3f35b42c0549619dfa54754fa62244af6c14
2024-06-12 10:04:30 -07:00
Lukasz Szaszkiewicz
5347b09f1d client-go/reflector: remove reflector_data_consistency_detector_test.go
Kubernetes-commit: 0c96a00217d6e2a4c9cb1cf6c0bc719d570678fc
2024-06-11 10:42:07 +02:00
Lukasz Szaszkiewicz
9a760efea1 client-go/util/watchlist: intro CanUseWatchListForListRequest
Kubernetes-commit: 38fae9b799393f6fe17d07fb8148f05b1110859b
2024-06-10 18:03:47 +02:00
Kubernetes Publisher
03443e7ede Merge pull request #125432 from p0lyn0mial/upstream-watch-list-data-consistency-detector
client-go/consistencydetector: add CheckWatchListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 27bdade27f9f4c2b60928a18579de369c9f8c2ef
2024-06-11 01:22:25 -07:00
Lukasz Szaszkiewicz
b681e77bec client-go/reflector: use consistencydetector.IsDataConsistencyDetectionForWatchListEnabled
Kubernetes-commit: f6c68908ba37dbb7af602b8f88b5f395025d2384
2024-06-10 23:01:04 +02:00
Lukasz Szaszkiewicz
14559c0fec client-go/consistencydetector: introduce CheckWatchListFromCacheDataConsistencyIfRequested
Kubernetes-commit: f7f3809c513cd051c2c45bbef0655cf5a3eceea2
2024-06-10 22:52:47 +02:00
Kubernetes Publisher
911684686f Merge pull request #125408 from benluddy/bump-cbor-v2.7.0
KEP-4222: Bump github.com/fxamacker/cbor/v2.

Kubernetes-commit: 6346b9d1327c4b8be2398d9715bdae5475e27569
2024-06-11 00:41:19 +00:00
Ben Luddy
4d57b6a340 Bump fxamacker/cbor/v2 to v2.7.0-beta.
This library release makes a number of behaviors configurable in ways that are required for CBOR
support in Kubernetes.

Kubernetes-commit: c4279660cad039bc15495311cf7863640b6308f9
2024-05-09 14:30:58 -04:00
Kubernetes Publisher
c415c7650f Merge pull request #125304 from p0lyn0mial/upstream-dynamic-client-uses-consistency-detector
dynamic-client: data consistency checker for list requests

Kubernetes-commit: e328c8fbf18f50e3d9dff430af482e703124147d
2024-06-09 16:40:52 +00:00
Kubernetes Publisher
8fc5a64651 Merge pull request #125383 from p0lyn0mial/upstream-unstructured-testchecklistconsistency
client-go/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data

Kubernetes-commit: 51f89c3b2d114fea99d3a0e8401c639f39e27877
2024-06-07 07:50:55 -07:00
Lukasz Szaszkiewicz
503a0905c0 client-go/util/consistencydetector: extend TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured list
Kubernetes-commit: a2a48a475b4c98daeea3f83b8a89aa070ea4082b
2024-06-07 10:55:01 +02:00
Lukasz Szaszkiewicz
2d885a2ed5 client-go/util/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data
Kubernetes-commit: c5904424b2b03cec1befaf16c55bb97df57669bc
2024-06-07 10:43:28 +02:00
Kubernetes Publisher
e8224736d3 Merge pull request #125379 from p0lyn0mial/upstream-unstructured-testdataconsistencychecker
client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data

Kubernetes-commit: 96815d6dc8de717579484ffef88f74063dfd40ca
2024-06-07 16:41:08 +00:00
Kubernetes Publisher
94cabc85d9 Merge pull request #125302 from karlkfi/karl-informer-watcher-test
Update TestNewInformerWatcher for WatchListClient

Kubernetes-commit: 169a952720ebd75fcbcb4f3f5cc64e82fdd3ec45
2024-06-07 12:40:56 +00:00
Kubernetes Publisher
1fc4f8ad34 Merge pull request #124963 from p0lyn0mial/upstream-data-consistency-checker-for-list-requests
client-go: data consistency checker for list requests

Kubernetes-commit: 3532601ad8c7249be13cd8187f8124fc68da4c4b
2024-06-07 08:40:44 +00:00
Lukasz Szaszkiewicz
20d0a8ee82 client-go/consistencydetector: extend TestDataConsistencyChecker to test unstructured data
Kubernetes-commit: c8971c456f23627a91dc79bb8bc840a32dea611f
2024-06-07 10:33:11 +02:00
Kubernetes Publisher
1c075dc88c Merge pull request #124642 from wojtek-t/resilient_watchcache_initialization
Implement ResilientWatchCacheInitialization

Kubernetes-commit: eef6c6082d4e34fc4a0675a36ec5cc575cd13696
2024-06-07 04:40:45 +00:00
Kubernetes Publisher
098e7c5a9b Merge pull request #125356 from p0lyn0mial/upstream-improve-testdrivechecklistfromcache-test
improve TestDriveCheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 4e2a6201a43f4c8bbb633ae8edc8cc47b1a39ee7
2024-06-06 16:44:40 +00:00
Lukasz Szaszkiewicz
82627741cb client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data
Kubernetes-commit: d535f55ef9dd391712db09ac69dd083089457366
2024-06-06 14:14:33 +02:00
Lukasz Szaszkiewicz
bbe85a4a80 fix TestDriveCheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 82794c4963144bf5298089030733f993a44f7c3b
2024-06-05 22:41:09 +02:00
Kubernetes Publisher
b03e5b8438 Merge pull request #125335 from p0lyn0mial/upstream-consistency-decector-handles-legacy-case
client-go/consistencydetector: handles the watch cache legacy case

Kubernetes-commit: dae37c21645c0fc04bbb0202ad1eba6ba4438d23
2024-06-05 05:37:20 -07:00
Lukasz Szaszkiewicz
c7d706847a client-go/consistencydetector: handles the watch cache legacy case
Kubernetes-commit: fe8a2d222cc4208ee8f89fd2912d35cf58ec5941
2024-06-04 18:37:37 +02:00
Lukasz Szaszkiewicz
5d84e91dbf client-go/dynamic: use CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 79370c6d676814758c60bbc1b71a882583be2214
2024-06-04 10:23:19 +02:00
Kubernetes Publisher
7c6e307a72 Merge pull request #125299 from karlkfi/karl-reflector-fix-2
Improve Reflector unit tests

Kubernetes-commit: 5bf1e95541d90e37f6c6637b5b45d8783e7907aa
2024-06-04 00:39:33 +00:00
Karl Isenberg
7c5e9038dd Update TestNewInformerWatcher for WatchListClient
- Switch to using the ProxyWatcher to validate the dance between
  closing the stop channel and closing the result channel.
- Use the new clientfeaturestesting.SetFeatureDuringTest to test with
  the WatchListClient enabled and disabled. These should result in
  almost the exact same output events from the informer
  (list ordering not garenteed), but with different input events
  recieved from the apiserver.

Kubernetes-commit: 28e3a728e5e6fe651d7a17839d33ce42204c0b4e
2024-06-03 17:31:59 -07:00
Karl Isenberg
8c9cb8838f Improve Reflector unit tests
- Add tests to confirm that Stop is always called.
- Add TODOs to show were Stop is not currently being called
  (to fix in a future PR)

Kubernetes-commit: ab5aa4762fd5206d0dbd8412d7c6f3b76533a122
2024-06-03 12:15:38 -07:00
Kubernetes Publisher
52e5651101 Merge pull request #122832 from benluddy/cbor-fuzz-native-to-unstructured-via
KEP-4222: Add roundtrip tests to Unstructured via CBOR and JSON.

Kubernetes-commit: f30a87d517c538f22e1d84b4d7c497f57f7b760a
2024-05-31 00:39:27 +00:00
Kubernetes Publisher
d81b8f6492 Merge pull request #123974 from p0lyn0mial/upstream-client-go-features-testing
client-go/features/testing: intro SetFeatureGatesDuringTest

Kubernetes-commit: 9a44f689167849e1251f801199e9517ee00fe6bd
2024-05-30 00:39:20 +00:00
Shingo Omura
7adab2f2f6 KEP-3619: Fine-grained SupplementalGroups control (#117842)
* Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api

* Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate

* Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields

* Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet

* Clarify `SupplementalGroupsPolicy` is an OS depdendent field.

* Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus

It is because, the process identity can be dynamic if the initially attached identity
has enough privilege calling setuid/setgid/setgroups syscalls in Linux.

* Rewording suggestion applied

* Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34

* Added validations for SupplementalGroupsPolicy and ContainerUser

* No need featuregate check in validation when adding new field with no default value

* fix typo: identitiy -> identity

Kubernetes-commit: 552fd7e85084b4cbd3ae8e81ff13433e28dc8327
2024-05-30 00:39:19 +00:00
Kubernetes Publisher
e8b54718d0 Merge pull request #123339 from skitt/canonical-json-patch
Update kustomize, use canonical json-patch v4 import

Kubernetes-commit: da02fdb2aef1b7102526963c91df4992ee5b6a05
2024-05-29 20:39:23 +00:00
Kubernetes Publisher
9c87eb0815 Merge pull request #125190 from pohly/record-event-panic
client-go record: avoid panic when watch creation failed

Kubernetes-commit: ea0ab06b6915945c20a86d1de588e4ac7a5b6d58
2024-05-29 06:20:33 -07:00
Patrick Ohly
b4e1cfcfab client-go record: avoid panic when watch creation failed
The previous attempt to fix this in
6aa779f4ed (diff-efa2cd1347df22ace5a516ea794152d00ef2a079db135c81787ed920ecb73658)
didn't address the root cause (or perhaps created it, not sure): the goroutine
must not be started if watch creation failed.

Instead, the error gets logged (as before) and an empty watch gets returned to
the caller (new). This is necessary because the function doesn't have an error
return value and changing that now would be disruptive. The empty watch is
valid and usable, so callers won't crash when they calls Stop.

This showed up recently in failed unit tests, probably because test
cancellation makes this error more likely:

   "Unable start event watcher (will not retry!)" err="broadcaster already
   stopped" logger="TestGarbageCollectorConstruction leaked goroutine"

The logger value and a preceding warning show that this occurs after test
completion.

Kubernetes-commit: 080432c46a7a49c3abf86d7fc5f2a5d7abc92239
2024-05-29 14:10:49 +02:00
Kubernetes Publisher
5d650114a5 Merge pull request #125159 from p0lyn0mial/upstream-add-data-consistency-checker-for-list-requests
client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested

Kubernetes-commit: 1d5589e4910ed859a69b3e57c25cbbd3439cd65f
2024-05-29 12:39:08 +00:00
Kubernetes Publisher
3f130bd830 Merge pull request #125166 from p0lyn0mial/upstream-improve-check-data-consistency
client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)

Kubernetes-commit: bc8ec4f9aaaeee7de285c0207bd8eb793ecf3307
2024-05-29 00:38:51 +00:00
Kubernetes Publisher
5f741a5d35 Merge pull request #125052 from p0lyn0mial/upstream-client-go-env-var-set
client-go/features: add Set method to the envvar impl

Kubernetes-commit: 8991e825d5f2affce16a05666c11d7a2a773a628
2024-05-28 16:39:07 +00:00
Kubernetes Publisher
b92b563c44 Merge pull request #124635 from pohly/event-broadcaster-shutdown-fix
client-go/tools/record: fix and test Broadcaster shutdown + logging

Kubernetes-commit: f4ea903712482c4a0021cc9c8d742673a213833e
2024-05-28 16:39:05 +00:00
Lukasz Szaszkiewicz
785fca481f client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions)
Kubernetes-commit: 327ae9866bda463ae43bd133a2522d5beea5ed35
2024-05-28 12:22:59 +02:00
Kubernetes Publisher
f53839a9ad Merge pull request #125045 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.19.0, gomega v1.33.1

Kubernetes-commit: 1c84623028b496e22d8401100ef6f59325e092e0
2024-05-28 08:39:08 +00:00
Lukasz Szaszkiewicz
9f33e96b6a make update
Kubernetes-commit: 448180db60fc1d62174a18d1dd995d8deb081428
2024-05-27 15:31:15 +02:00
Kubernetes Publisher
c559583d36 Merge pull request #125146 from p0lyn0mial/upstream-client-go-consistency-detector-move-to-new-package
client-go: move data consistency detector to a new package

Kubernetes-commit: 9d5db28f5f5d5a35012dd6162af374420e6e1f4c
2024-05-27 06:24:08 -07:00
Lukasz Szaszkiewicz
b7ea49a199 client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested
Kubernetes-commit: 48014bd7bdc331efea509a752694393ac929f270
2024-05-27 15:11:50 +02:00
Lukasz Szaszkiewicz
538b7809aa move checkWatchListDataConsistencyIfRequested back to client-go/tools/cache
Kubernetes-commit: cb44f83b3d500bb2ed29f7634095bc64c9b21729
2024-05-27 11:22:28 +02:00
Lukasz Szaszkiewicz
e6e45e172b client-go/util/consistencydetector: make the detector public
Kubernetes-commit: e421046f64c90b58577a79f92dd463ab03479d79
2024-05-27 11:16:17 +02:00
Lukasz Szaszkiewicz
92f0985ce1 client-go/util/consistencydetector: update after moving to the new package
Kubernetes-commit: faf5110c8a2394f9d098da6e5097ce6deed1b18b
2024-05-27 11:13:18 +02:00
Lukasz Szaszkiewicz
e428fc295c move client-go/tools/cache/reflector_data_consistency_detector to client-go/util/consistencydetector
Kubernetes-commit: 272dfc9d7e61481dfcdc4d6a021385d9cd85ba5f
2024-05-27 11:10:43 +02:00
Kubernetes Publisher
fd6b8e6551 Merge pull request #125144 from p0lyn0mial/upstream-client-go-consistency-detector-refactor-units
client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests

Kubernetes-commit: 58fe98e2cc7f8efac886765af230a48285d7b9b6
2024-05-27 03:26:50 -07:00
Lukasz Szaszkiewicz
00036b79c4 client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests
Kubernetes-commit: 18837d60ae12ac70380ce5cf21cfd8e0d221263a
2024-05-27 11:10:00 +02:00
Kubernetes Publisher
0123e78ef6 Merge pull request #124446 from p0lyn0mial/watch-list-consistency-detector-more-generic
client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested

Kubernetes-commit: f5d62f738a686ddc6221a85374113af80790129e
2024-05-27 08:39:07 +00:00
Lukasz Szaszkiewicz
e89e40c187 client-go/rest: add TestWatchListWhenFeatureGateDisabled unit test
Kubernetes-commit: 8c0c1f720182f138c3151d3d67a80fa67b86a240
2024-05-23 16:33:43 +02:00
Lukasz Szaszkiewicz
e8eae94e45 client-go/features/testing: intro SetFeatureGatesDuringTest
Kubernetes-commit: 3d97808b95b355bb8e56d4d720342e9a7ab95ced
2024-05-23 14:44:11 +02:00
Lukasz Szaszkiewicz
98df4f79ac client-go/features: add Set method to envvar impl
Kubernetes-commit: a07654baa54d53d7649e981c0c65eb8d1210e4af
2024-05-22 15:42:47 +02:00
Patrick Ohly
2f2b800097 dependencies: ginkgo v2.19.0, gomega v1.33.1
Ginkgo v2.18.0 allows tweaking the output so that
it's easier to follow while a job runs in
Prow (https://github.com/onsi/ginkgo/issues/1347). Using this in
hack/ginkgo-e2e.sh will follow in a separate commit.

Gomega gets bumped to the latest release to keep it up-to-date.

Ginkgo v1.19.0 adds support for --label-filter with labels that represent
sets (like our Feature:<Foo>).

Kubernetes-commit: 37e2dd6857084a172ef5210caee1fefa8dd8159a
2024-05-22 10:22:09 +02:00
Ben Luddy
3aa51ce508 Update indirect dependencies with ./hack/update-vendor.sh.
Implementing custom marshaling on several API types for CBOR makes the upstream CBOR library an
indirect dependency of several staging modules.

Kubernetes-commit: d7cccf3e792ad08d9ab2e7aac394f8e6ddcf3466
2024-05-17 13:02:26 -04:00
Patrick Ohly
ebbf7d7dc3 client-go/tools/record: fix and test Broadcaster shutdown + logging
Constructing a Broadcaster already starts a watch which runs in the
background. Shutdown must be called to avoid leaking the goroutine.  Providing
a context was supposed to remove the need to call Shutdown, but that did not
actually work because the logic for "must check for cancellation" was
accidentally inverted.

While at it, structured log output also gets tested together with checking for
goroutine leaks.

Kubernetes-commit: ff779f1cb56cf896405e52f7923188b99b88bb00
2024-04-30 12:16:55 +02:00
Wojciech Tyczyński
b444e6c32e Implement ResilientWatchCacheInitialization
Kubernetes-commit: a8ef6e9f0104a44023162bb8229fb677ec80beb1
2024-04-29 14:19:46 +02:00
Lukasz Szaszkiewicz
6bdde7723e client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested
the signature of the method was tightly connected to the reflector,
making it difficult to use for anything other than a reflector.

this simple refactor makes the method more generic.

Kubernetes-commit: 83c7542abc8c542c01ecb67376f134b2071c5304
2024-04-22 14:01:22 +02:00
Kubernetes Publisher
c7396197f3 Merge pull request #122791 from p0lyn0mial/upstream-cleanup-watch-list-env-var
cleanup: replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate

Kubernetes-commit: 8c1983ffc0b6fe2293fc721cef8d961d79aafc53
2024-05-21 02:05:35 -07:00
Lukasz Szaszkiewicz
4a34196022 replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate
Kubernetes-commit: 9248cccc27fdd52a9a99fd9ad6e47ada9ee8b568
2024-04-30 08:24:53 +02:00
Kubernetes Publisher
86f83bc818 Merge pull request #124614 from p0lyn0mial/upstream-reflector-warn-no-bookmark-event
client-go/reflector: warns when the bookmark event for initial events hasn't been received

Kubernetes-commit: b10a141fd2c291feea78c4e36483933b25368224
2024-05-20 16:38:45 +00:00
Lukasz Szaszkiewicz
0280901a4d client-go/reflector: warns when the bookmark event for initial events hasn't been received
Kubernetes-commit: 93960f489069a744afda1be42f82349e25d7e4d7
2024-04-29 15:18:54 +02:00
Kubernetes Publisher
62f959700d Merge pull request #124588 from jiuker/patch-2
fix: Hang when canceling leader election information

Kubernetes-commit: 7a6931b31cf04d2a91ce8c0af09ad0f474927436
2024-05-09 04:33:13 +00:00
Kubernetes Publisher
8a8d0731de Merge pull request #124757 from dims/update-to-latest-golang.org/x/oauth2-v0.20.0
Update to latest golang.org/x/oauth2 v0.20.0

Kubernetes-commit: 22578c545ffc04a505a7a64c9b8f6c78fefa07ef
2024-05-09 00:31:52 +00:00
Davanum Srinivas
988ddc2b6c Update to latest golang.org/x/oauth2 v0.20.0
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 04c40ac96134d7f7bf697d0a58caf0f8b0380075
2024-05-08 11:04:34 -04:00
Kubernetes Publisher
4ebe42d8c9 Merge pull request #124600 from alvaroaleman/typed-wq
Use the generic/typed workqueue throughout

Kubernetes-commit: 1dc30bf90fd6a729d226b4e942118110b0a73e65
2024-05-07 00:31:06 +00:00
Kubernetes Publisher
d3682da14f Merge pull request #124519 from dims/drop-all-the-providery-things-take-2
Remove gcp in-tree cloud provider and credential providers

Kubernetes-commit: 4d17d30029aaddc2132d65c019e30d1c153bf4d1
2024-05-06 16:31:39 +00:00
Patryk Małek
35cab326ad fix(api): make LocalObjectReference.Name and HostAlias.IP required (#124553)
* fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required

* chore(api): add LocalObjectReference comment

* chore(api): add omitempty to LocalObjectReference's Name

* chore(api): add kubebuilder:default annotation

* chore(api): ./hack/update-codegen.sh

Kubernetes-commit: 8dbeaa5786bab14772873cc90af70ccb9b06b4c1
2024-05-04 00:30:57 +00:00
Davanum Srinivas
64ff14beda address comments during review
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 7187d9af81eb1dc2691e7faeb1aaa254d85cc860
2024-05-01 09:06:11 -04:00
Kubernetes Publisher
049f231649 Merge pull request #124562 from sbueringer/pr-bump-sigs-yaml
Bump sigs.k8s.io/yaml to v1.4.0

Kubernetes-commit: c1ef6c44f5d7b582bf19669c6dbf2ff9552b9d6c
2024-04-29 21:36:55 +00:00
Alvaro Aleman
9aa3aae99d Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.

Kubernetes-commit: 6d0ac8c561a7ac66c21e4ee7bd1976c2ecedbf32
2024-04-28 18:26:18 +02:00
jiuker
f9eba8e8c3 fix: Hang when canceling leader election information
Hang when canceling leader election information.
Occasionally, two leaders may run simultaneously.

Kubernetes-commit: b6b46a0e00682517d2ca7b7e9c2706b8e407e52e
2024-04-28 15:06:51 +08:00
Stefan Bueringer
ea434dfecf Bump sigs.k8s.io/yaml to v1.4.0
Kubernetes-commit: 04cc45b4adda1b19d5067d45ed246c0f84fed966
2024-04-26 15:28:17 +02:00
Kubernetes Publisher
6b47d7dcbe Merge pull request #124344 from wojtek-t/fix_transformer
Fix race in informer transformers

Kubernetes-commit: 0b15f8cbfc611889f703495ee845b3c54bdd759d
2024-04-24 21:36:39 +00:00
Kubernetes Publisher
178bcf2846 Merge pull request #124469 from serathius/etcd-3.5.13
Upgrade etcd libraries to v3.5.13

Kubernetes-commit: 0f063280964b09e0e21c8cc457a181c20c68da61
2024-04-24 17:36:36 +00:00
Kubernetes Publisher
f3332a08cc Merge pull request #124263 from alvaroaleman/typed
Workqueue: Add generic versions that are properly typed

Kubernetes-commit: b3f5c5722352af8a4c9434d9ff6ba55baee16d36
2024-04-24 17:36:33 +00:00
Kubernetes Publisher
9433226579 Merge pull request #124075 from pohly/dra-api-comments
DRA: API cleanup + fix

Kubernetes-commit: 62895895094cbb59fe39176afd484ce3d2505b61
2024-04-24 01:36:42 +00:00
Kubernetes Publisher
4a5f039360 Merge pull request #122657 from p0lyn0mial/upstream-client-go-rest-client-watch-list
add watchlist to client-go rest client

Kubernetes-commit: 78533415e06199d13f81e78acf9ff2e0f7460801
2024-04-23 13:36:38 +00:00
Marek Siarkowicz
e4f9b83713 Upgrade etcd libraries to v3.5.13
Add otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents, otelgrpc.SentEvents) to tracing options due to https://github.com/open-telemetry/opentelemetry-go-contrib/pull/3964

Kubernetes-commit: 3e5b03eb433ee359782f5aa6e9368ab2a0d0370c
2024-04-23 11:10:37 +02:00
Kubernetes Publisher
47f558294c Merge pull request #124328 from jiahuif-forks/deps/cel-go
bump cel-go to v0.20.1 and refit CEL libraries

Kubernetes-commit: 16a594f907d0d4a6224dab2d0704793d5e7898f6
2024-04-23 01:36:50 +00:00
Kubernetes Publisher
66b378aea8 Merge pull request #124340 from benluddy/dynamic-client-golden-request-test
Add test to detect unintentional changes in dynamic client requests.

Kubernetes-commit: 80134bcc85fb753c5809b341bb5e34e422ca4b37
2024-04-23 01:36:48 +00:00
Kubernetes Publisher
02e371e437 Merge pull request #121574 from skitt/generic-lister-gen
Generify lister-gen

Kubernetes-commit: 6b260382a1b5e461c39289892b1d3a3b335ecc67
2024-04-23 01:36:47 +00:00
Jiahui Feng
d071c08540 generated: ./hack/update-vendor.sh
Kubernetes-commit: 350fcf957e90501f0b224b7ccf771b29d4d5c6b6
2024-04-22 10:54:32 -07:00
Kubernetes Publisher
5b2b83af72 Merge pull request #124346 from jwcesign/master
upgrade: upgrade dependencies github.com/prometheus/common to the newest version

Kubernetes-commit: 76de052680da0b7a59b35fb79db7ab322faf2854
2024-04-22 17:36:45 +00:00
Stephen Kitt
841e997e33 Improve the lister function documentation
In particular, document that ListAllByNamespace delegates to ListAll
if no namespace is specified.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 54e899317ef46e3b70827cacee244717022db0ad
2024-04-19 17:58:02 +02:00
jwcesign
5db05eb767 upgrade: upgrade dependencies github.com/prometheus/common to the newest version
Signed-off-by: jwcesign <jwcesign@gmail.com>

Kubernetes-commit: f0aa62bc96d6e734249adfa3e094a52e45c8fb6d
2024-04-17 18:15:27 +08:00
Kubernetes Publisher
b1c1c0345d Merge pull request #122892 from danwinship/codegen-nil
Fix generated fake clients to have same semantics as real clients on error

Kubernetes-commit: 573832a42f03af912a5611eb4e81a0e812a5ddf2
2024-04-18 17:36:39 +00:00
Kubernetes Publisher
506bc538e6 Merge pull request #113257 from claudiubelu/path-filepath-update-staging
Replaces path.Operation with filepath.Operation (staging)

Kubernetes-commit: 80542ca2e318f6f82429822b267497570b7ecca5
2024-04-18 17:36:38 +00:00
Kubernetes Publisher
3407442ff2 Merge pull request #124245 from wojtek-t/informer_options
Allow for configuring MinWatchTimeout in reflector

Kubernetes-commit: 32a3cbc51dd1d572ba3d6eba66df333e1454dd58
2024-04-18 13:36:35 +00:00
Kubernetes Publisher
9990b0b122 Merge pull request #123969 from liangyuanpeng/cleanup_rand
cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.

Kubernetes-commit: 7f67cb5960d8f93e6f005821d2c1b12dcde3dece
2024-04-18 09:36:51 +00:00
Kubernetes Publisher
a82df61b84 Merge pull request #123937 from p0lyn0mial/upstream-use-initial-events-annotation-key-const
use metav1.InitialEventsAnnotationKey const

Kubernetes-commit: c016b0b9a8ca63dbec1fade0910c2a06017cc4ab
2024-04-18 09:36:50 +00:00
Kubernetes Publisher
79491afc36 Merge pull request #123347 from zhouhaibing089/abstract-queue
workqueue: make queue as configurable

Kubernetes-commit: 301eb8d47a794393a85a9449ab6b29d902ed06bd
2024-04-18 09:36:49 +00:00
Wojciech Tyczyński
2fe05741c1 Fix race in informer transformers
Kubernetes-commit: e9f74597a8e7104b26640614e952d4453654453b
2024-04-17 11:19:08 +02:00
Ben Luddy
4cd6b756be Generate HTTP request fixtures for dynamic client tests.
Kubernetes-commit: e335b8e81b467c70f0f8a485f69e5664adbbc687
2024-04-16 12:49:15 -04:00
Ben Luddy
b17c363481 Add test to detect unintentional changes in dynamic client requests.
Kubernetes-commit: a803c8034d60a81b0da71ea8631e27888a607476
2024-04-16 12:48:12 -04:00
Jiahui Feng
34d780971c generated: ./hack/pin-dependency.sh github.com/google/cel-go v0.20.1
Kubernetes-commit: 94997c6fefa2791192d0a7ab68b02bf5d8b6c2c5
2024-04-15 13:33:10 -07:00
Alvaro Aleman
d67dddfe90 Workqueue: Add generic versions that are properly typed
This change adds a generic version of the various workqueue types while
retaining compatibility for the existing exported symbols and constructors.
The generic variants are prefixed with `Typed` and the existing ones are
marked as deprecated to nudge people to transition without breaking
them.

Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc
2024-04-11 18:11:41 -04:00
Wojciech Tyczyński
b9e952f4d7 Allow for configuring MinWatchTimeout in Reflector and Informer.
Kubernetes-commit: 29e38c19b853b6cc3950541b1727395acf5eb4d3
2024-04-09 09:12:54 +02:00
Wojciech Tyczyński
7da319745b Refactor informer constructors
Kubernetes-commit: 4da185a601e1f657a873dfd7e51efcc8a3b94c37
2024-04-09 09:06:38 +02:00
Kubernetes Publisher
aa7909e7d7 Merge pull request #124174 from dims/update-x/net-for-CVE-2023-45288
Update x/net for CVE-2023-45288

Kubernetes-commit: d9c54f69d4bb7ae1bb655e1a2a50297d615025b5
2024-04-04 03:56:29 +00:00
Davanum Srinivas
a2cc490854 Update x/net for CVE-2023-45288
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 99fac38d2864e6bc9bb7cd1743d658caa1360c0c
2024-04-03 16:37:18 -04:00
Patrick Ohly
a457c5ed68 DRA api: ResourceHandle.DriverName is required
It was already required via validation, but not declared as such by the
OpenAPI.

Kubernetes-commit: 1a13b0aa3333d04ae67a6fcdd21c8e2a042dc0c2
2024-03-27 11:22:35 +01:00
Kubernetes Publisher
1518fca9f0 sync: update go.mod 2024-03-18 11:59:16 +00:00
Lan Liang
fa185a21db cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator.
see https://tip.golang.org/doc/go1.20

Signed-off-by: Lan Liang <gcslyp@gmail.com>

Kubernetes-commit: dc992adad385ab631e4a528ee6a342ea71e7a379
2024-03-18 08:10:12 +00:00
Kubernetes Publisher
eea636f8f4 Merge pull request #123932 from pohly/dra-api-resource-model-rename
dra api: NodeResourceModel -> ResourceModel

Kubernetes-commit: d194e6d06c4f1004cebe00f2c539a564f77276ec
2024-03-14 20:57:49 +00:00
Lukasz Szaszkiewicz
45e17fede0 client-go/cache/reflector: use metav1.InitialEventsAnnotationKey
Kubernetes-commit: a953539fb57b2ee18337f323ef15425a4d6207ed
2024-03-11 12:56:40 +01:00
Haibing Zhou
9c3db8681d workqueue: make queue as configurable
The default queue implementation is mostly FIFO and it is not
exchangeable unless we implement the whole `workqueue.Interface` which
is less desirable as we have to duplicate a lot of code. There was one
attempt done in [kubernetes/kubernetes#109349][1] which tried to
implement a priority queue. That is really useful and [knative/pkg][2]
implemented something called two-lane-queue. While two lane queue is
great, but isn't perfect since a full slow queue can still slow down
items in fast queue.

This change proposes a swappable queue implementation while not adding
extra maintenance effort in kubernetes community. We are happy to
maintain our own queue implementation (similar to two-lane-queue) in
downstream.

[1]: https://github.com/kubernetes/kubernetes/pull/109349
[2]: https://github.com/knative/pkg/blob/main/controller/two_lane_queue.go

Kubernetes-commit: 87b4279e07349b3c68f16f69a349a02bddd12f25
2024-02-16 12:09:37 -08:00
Stephen Kitt
16552d4656 Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 5300466a5c8988b479a151ceb77f49dd00065c83
2024-02-16 13:57:24 +01:00
Stephen Kitt
ffda3468aa Update kubectl kustomize to kyaml/v0.17.1, cmd/config/v0.14.1, api/v0.17.2, kustomize/v5.4.2
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 33c6f6bc65395aa514c9cf17115a1c63564c22e7
2024-05-27 17:42:29 +02:00
Davanum Srinivas
af62623c06 Remove gcp in-tree cloud provider and credential provider
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: bf268f02a3567c1af29199c27a7cf61cca494b2d
2024-01-25 08:47:20 -05:00
Dan Winship
3d4f98db0e Regenerate fake clients
Kubernetes-commit: 17ab25b121d05355700f39628d5d45ab3da446f8
2024-01-20 10:20:43 -05:00
Lukasz Szaszkiewicz
a1be94abc3 client-go/rest: introduce watchlist
Kubernetes-commit: ad3d138cda76fc0267da5131fa3ff7906e2ddf76
2024-01-08 16:43:26 +01:00
Stephen Kitt
9d701d3504 Regenerate all listers
Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: e6f44957cdb961d1ada2ae570d331c6bc0ecc8e2
2023-11-09 17:39:39 +01:00
Stephen Kitt
05ff4bb2fd Generify lister-gen
This adds a generic implementation of a lister, and uses it to replace
the template code in generated listers. The corresponding templates
are no longer used and are removed.

Listers are reduced to their interfaces (non-namespaced and namespaced
if appropriate), their specific structs, and their constructors. All
method implementations are provided by the generic implementation. The
dedicated interface is preserved so that each lister can have its own
set of methods (e.g. the method returning the namespaced lister if
appropriate), and the dedicated struct is preserved to allow
expansions to be defined where necessary.

The external interface is unchanged and doesn't expose generics.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 2e9adcd14aae27394238291fa08fb603bf2f3e77
2023-10-27 16:57:01 +02:00
Claudiu Belu
79c893df5a Replaces path.Operation with filepath.Operation (staging)
The path module has a few different functions:
Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not
take into account the OS-specific path separator, meaning that they
won't behave as intended on Windows.

For example, Dir is supposed to return all but the last element of the
path. For the path "C:\some\dir\somewhere", it is supposed to return
"C:\some\dir\", however, it returns ".".

Instead of these functions, the ones in filepath should be used instead.

Kubernetes-commit: 856bb5c8f266f5276f1a576f47be622d7cb384e7
2022-06-15 15:17:24 +03:00
444 changed files with 11753 additions and 6322 deletions

View File

@@ -37,6 +37,7 @@ type ContainerStatusApplyConfiguration struct {
AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"`
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"`
User *ContainerUserApplyConfiguration `json:"user,omitempty"`
}
// ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with
@@ -145,3 +146,11 @@ func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMo
}
return b
}
// WithUser sets the User field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the User field is set to the value of the last call.
func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyConfiguration) *ContainerStatusApplyConfiguration {
b.User = value
return b
}

View File

@@ -0,0 +1,39 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// ContainerUserApplyConfiguration represents an declarative configuration of the ContainerUser type for use
// with apply.
type ContainerUserApplyConfiguration struct {
Linux *LinuxContainerUserApplyConfiguration `json:"linux,omitempty"`
}
// ContainerUserApplyConfiguration constructs an declarative configuration of the ContainerUser type for use with
// apply.
func ContainerUser() *ContainerUserApplyConfiguration {
return &ContainerUserApplyConfiguration{}
}
// WithLinux sets the Linux field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Linux field is set to the value of the last call.
func (b *ContainerUserApplyConfiguration) WithLinux(value *LinuxContainerUserApplyConfiguration) *ContainerUserApplyConfiguration {
b.Linux = value
return b
}

View File

@@ -0,0 +1,59 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
// LinuxContainerUserApplyConfiguration represents an declarative configuration of the LinuxContainerUser type for use
// with apply.
type LinuxContainerUserApplyConfiguration struct {
UID *int64 `json:"uid,omitempty"`
GID *int64 `json:"gid,omitempty"`
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
}
// LinuxContainerUserApplyConfiguration constructs an declarative configuration of the LinuxContainerUser type for use with
// apply.
func LinuxContainerUser() *LinuxContainerUserApplyConfiguration {
return &LinuxContainerUserApplyConfiguration{}
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *LinuxContainerUserApplyConfiguration) WithUID(value int64) *LinuxContainerUserApplyConfiguration {
b.UID = &value
return b
}
// WithGID sets the GID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GID field is set to the value of the last call.
func (b *LinuxContainerUserApplyConfiguration) WithGID(value int64) *LinuxContainerUserApplyConfiguration {
b.GID = &value
return b
}
// WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the SupplementalGroups field.
func (b *LinuxContainerUserApplyConfiguration) WithSupplementalGroups(values ...int64) *LinuxContainerUserApplyConfiguration {
for i := range values {
b.SupplementalGroups = append(b.SupplementalGroups, values[i])
}
return b
}

View File

@@ -25,17 +25,18 @@ import (
// PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use
// with apply.
type PodSecurityContextApplyConfiguration struct {
SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"`
WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"`
RunAsUser *int64 `json:"runAsUser,omitempty"`
RunAsGroup *int64 `json:"runAsGroup,omitempty"`
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
FSGroup *int64 `json:"fsGroup,omitempty"`
Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"`
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"`
WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"`
RunAsUser *int64 `json:"runAsUser,omitempty"`
RunAsGroup *int64 `json:"runAsGroup,omitempty"`
RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"`
SupplementalGroups []int64 `json:"supplementalGroups,omitempty"`
SupplementalGroupsPolicy *corev1.SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty"`
FSGroup *int64 `json:"fsGroup,omitempty"`
Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"`
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
}
// PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with
@@ -94,6 +95,14 @@ func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...
return b
}
// WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call.
func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroupsPolicy(value corev1.SupplementalGroupsPolicy) *PodSecurityContextApplyConfiguration {
b.SupplementalGroupsPolicy = &value
return b
}
// WithFSGroup sets the FSGroup field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the FSGroup field is set to the value of the last call.

View File

@@ -5084,6 +5084,9 @@ var schemaYAML = typed.YAMLObject(`types:
type:
namedType: io.k8s.api.core.v1.ContainerState
default: {}
- name: user
type:
namedType: io.k8s.api.core.v1.ContainerUser
- name: volumeMounts
type:
list:
@@ -5092,6 +5095,12 @@ var schemaYAML = typed.YAMLObject(`types:
elementRelationship: associative
keys:
- mountPath
- name: io.k8s.api.core.v1.ContainerUser
map:
fields:
- name: linux
type:
namedType: io.k8s.api.core.v1.LinuxContainerUser
- name: io.k8s.api.core.v1.DaemonEndpoint
map:
fields:
@@ -5661,7 +5670,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: ip
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.HostPathVolumeSource
map:
fields:
@@ -5852,6 +5860,23 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
namedType: io.k8s.api.core.v1.LimitRangeItem
elementRelationship: atomic
- name: io.k8s.api.core.v1.LinuxContainerUser
map:
fields:
- name: gid
type:
scalar: numeric
default: 0
- name: supplementalGroups
type:
list:
elementType:
scalar: numeric
elementRelationship: atomic
- name: uid
type:
scalar: numeric
default: 0
- name: io.k8s.api.core.v1.LoadBalancerIngress
map:
fields:
@@ -6748,7 +6773,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: ip
type:
scalar: string
default: ""
- name: io.k8s.api.core.v1.PodOS
map:
fields:
@@ -6824,6 +6848,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
scalar: numeric
elementRelationship: atomic
- name: supplementalGroupsPolicy
type:
scalar: string
- name: sysctls
type:
list:
@@ -12424,6 +12451,7 @@ var schemaYAML = typed.YAMLObject(`types:
- name: driverName
type:
scalar: string
default: ""
- name: structuredData
type:
namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle

View File

@@ -681,6 +681,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ContainerStatus"):
return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("ContainerUser"):
return &applyconfigurationscorev1.ContainerUserApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"):
return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"):
@@ -767,6 +769,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"):
return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LinuxContainerUser"):
return &applyconfigurationscorev1.LinuxContainerUserApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"):
return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"):

248
dynamic/golden_test.go Normal file
View File

@@ -0,0 +1,248 @@
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package dynamic_test
import (
"context"
"fmt"
"net"
"net/http"
"net/http/httptest"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"testing"
"time"
"github.com/google/go-cmp/cmp"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
)
func TestGoldenRequest(t *testing.T) {
for _, tc := range []struct {
name string
do func(context.Context, dynamic.Interface) error
}{
{
name: "create",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Create(
ctx,
&unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{"name": "mips"},
}},
metav1.CreateOptions{FieldValidation: "warn"},
"fin",
)
return err
},
},
{
name: "update",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Update(
ctx,
&unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{"name": "mips"},
}},
metav1.UpdateOptions{FieldValidation: "warn"},
"fin",
)
return err
},
},
{
name: "updatestatus",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").UpdateStatus(
ctx,
&unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{"name": "mips"},
}},
metav1.UpdateOptions{FieldValidation: "warn"},
)
return err
},
},
{
name: "delete",
do: func(ctx context.Context, client dynamic.Interface) error {
return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Delete(
ctx,
"mips",
metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}},
"fin",
)
},
},
{
name: "deletecollection",
do: func(ctx context.Context, client dynamic.Interface) error {
return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").DeleteCollection(
ctx,
metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}},
metav1.ListOptions{ResourceVersion: "42"},
)
},
},
{
name: "get",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Get(
ctx,
"mips",
metav1.GetOptions{ResourceVersion: "42"},
"fin",
)
return err
},
},
{
name: "list",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").List(
ctx,
metav1.ListOptions{ResourceVersion: "42"},
)
return err
},
},
{
name: "watch",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Watch(
ctx,
metav1.ListOptions{ResourceVersion: "42"},
)
return err
},
},
{
name: "patch",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Patch(
ctx,
"mips",
types.StrategicMergePatchType,
[]byte("{\"foo\":\"bar\"}\n"),
metav1.PatchOptions{FieldManager: "baz"},
"fin",
)
return err
},
},
{
name: "apply",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Apply(
ctx,
"mips",
&unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{"name": "mips"},
}},
metav1.ApplyOptions{Force: true},
"fin",
)
return err
},
},
{
name: "applystatus",
do: func(ctx context.Context, client dynamic.Interface) error {
_, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").ApplyStatus(
ctx,
"mips",
&unstructured.Unstructured{Object: map[string]interface{}{
"metadata": map[string]interface{}{"name": "mips"},
}},
metav1.ApplyOptions{Force: true},
)
return err
},
},
} {
t.Run(tc.name, func(t *testing.T) {
handled := make(chan struct{})
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer close(handled)
got, err := httputil.DumpRequest(r, true)
if err != nil {
t.Fatal(err)
}
path := filepath.Join("testdata", filepath.FromSlash(t.Name()))
if os.Getenv("UPDATE_DYNAMIC_CLIENT_FIXTURES") == "true" {
err := os.WriteFile(path, got, os.FileMode(0755))
if err != nil {
t.Fatalf("failed to update fixture: %v", err)
}
}
want, err := os.ReadFile(path)
if err != nil {
t.Fatalf("failed to load fixture: %v", err)
}
if diff := cmp.Diff(got, want); diff != "" {
t.Errorf("unexpected difference from expected bytes:\n%s", diff)
}
}))
defer srv.Close()
client, err := dynamic.NewForConfig(&rest.Config{
Host: "example.com",
UserAgent: "TestGoldenRequest",
Transport: &http.Transport{
// The client will send a static Host header while always
// connecting to the test server.
DialContext: func(ctx context.Context, network string, addr string) (net.Conn, error) {
u, err := url.Parse(srv.URL)
if err != nil {
return nil, fmt.Errorf("failed to parse test server url: %w", err)
}
return (&net.Dialer{}).DialContext(ctx, "tcp", u.Host)
},
},
})
if err != nil {
t.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
if err := tc.do(ctx, client); err != nil {
// This test detects server-perceptible changes to the request. As
// long as the server receives the expected request, a non-nil error
// returned from a client method is not a failure.
t.Logf("client returned non-nil error: %v", err)
}
select {
case <-handled:
default:
t.Fatal("no request received")
}
})
}
}

View File

@@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/rest"
"k8s.io/client-go/util/consistencydetector"
)
type DynamicClient struct {
@@ -292,7 +293,16 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav
return uncastObj.(*unstructured.Unstructured), nil
}
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (result *unstructured.UnstructuredList, err error) {
defer func() {
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result)
}
}()
return c.list(ctx, opts)
}
func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
if err := validateNamespaceWithOptionalName(c.namespace); err != nil {
return nil, err
}

9
dynamic/testdata/TestGoldenRequest/apply vendored Executable file
View File

@@ -0,0 +1,9 @@
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?force=true HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 29
Content-Type: application/apply-patch+yaml
User-Agent: TestGoldenRequest
{"metadata":{"name":"mips"}}

View File

@@ -0,0 +1,9 @@
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?force=true HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 29
Content-Type: application/apply-patch+yaml
User-Agent: TestGoldenRequest
{"metadata":{"name":"mips"}}

9
dynamic/testdata/TestGoldenRequest/create vendored Executable file
View File

@@ -0,0 +1,9 @@
POST /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 29
Content-Type: application/json
User-Agent: TestGoldenRequest
{"metadata":{"name":"mips"}}

9
dynamic/testdata/TestGoldenRequest/delete vendored Executable file
View File

@@ -0,0 +1,9 @@
DELETE /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 60
Content-Type: application/json
User-Agent: TestGoldenRequest
{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]}

View File

@@ -0,0 +1,9 @@
DELETE /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 60
Content-Type: application/json
User-Agent: TestGoldenRequest
{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]}

6
dynamic/testdata/TestGoldenRequest/get vendored Executable file
View File

@@ -0,0 +1,6 @@
GET /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?resourceVersion=42 HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
User-Agent: TestGoldenRequest

6
dynamic/testdata/TestGoldenRequest/list vendored Executable file
View File

@@ -0,0 +1,6 @@
GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
User-Agent: TestGoldenRequest

9
dynamic/testdata/TestGoldenRequest/patch vendored Executable file
View File

@@ -0,0 +1,9 @@
PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldManager=baz HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 14
Content-Type: application/strategic-merge-patch+json
User-Agent: TestGoldenRequest
{"foo":"bar"}

9
dynamic/testdata/TestGoldenRequest/update vendored Executable file
View File

@@ -0,0 +1,9 @@
PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 29
Content-Type: application/json
User-Agent: TestGoldenRequest
{"metadata":{"name":"mips"}}

View File

@@ -0,0 +1,9 @@
PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?fieldValidation=warn HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
Content-Length: 29
Content-Type: application/json
User-Agent: TestGoldenRequest
{"metadata":{"name":"mips"}}

6
dynamic/testdata/TestGoldenRequest/watch vendored Executable file
View File

@@ -0,0 +1,6 @@
GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42&watch=true HTTP/1.1
Host: example.com
Accept: application/json
Accept-Encoding: gzip
User-Agent: TestGoldenRequest

View File

@@ -37,12 +37,12 @@ import (
// Controller demonstrates how to implement a controller with client-go.
type Controller struct {
indexer cache.Indexer
queue workqueue.RateLimitingInterface
queue workqueue.TypedRateLimitingInterface[string]
informer cache.Controller
}
// NewController creates a new Controller.
func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller) *Controller {
func NewController(queue workqueue.TypedRateLimitingInterface[string], indexer cache.Indexer, informer cache.Controller) *Controller {
return &Controller{
informer: informer,
indexer: indexer,
@@ -62,7 +62,7 @@ func (c *Controller) processNextItem() bool {
defer c.queue.Done(key)
// Invoke the method containing the business logic
err := c.syncToStdout(key.(string))
err := c.syncToStdout(key)
// Handle the error if something went wrong during the execution of the business logic
c.handleErr(err, key)
return true
@@ -90,7 +90,7 @@ func (c *Controller) syncToStdout(key string) error {
}
// handleErr checks if an error happened and makes sure we will retry later.
func (c *Controller) handleErr(err error, key interface{}) {
func (c *Controller) handleErr(err error, key string) {
if err == nil {
// Forget about the #AddRateLimited history of the key on every successful synchronization.
// This ensures that future processing of updates for this key is not delayed because of
@@ -168,7 +168,7 @@ func main() {
podListWatcher := cache.NewListWatchFromClient(clientset.CoreV1().RESTClient(), "pods", v1.NamespaceDefault, fields.Everything())
// create the workqueue
queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter())
queue := workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]())
// Bind the workqueue to a cache with the help of an informer. This way we make sure that
// whenever the cache is updated, the pod key is added to the workqueue.

View File

@@ -47,6 +47,10 @@ var _ Gates = &envVarFeatureGates{}
//
// Please note that environmental variables can only be set to the boolean value.
// Incorrect values will be ignored and logged.
//
// Features can also be set directly via the Set method.
// In that case, these features take precedence over
// features set via environmental variables.
func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates {
known := map[Feature]FeatureSpec{}
for name, spec := range features {
@@ -57,7 +61,8 @@ func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates
callSiteName: naming.GetNameFromCallsite(internalPackages...),
known: known,
}
fg.enabled.Store(map[Feature]bool{})
fg.enabledViaEnvVar.Store(map[Feature]bool{})
fg.enabledViaSetMethod = map[Feature]bool{}
return fg
}
@@ -74,17 +79,34 @@ type envVarFeatureGates struct {
// known holds known feature gates
known map[Feature]FeatureSpec
// enabled holds a map[Feature]bool
// enabledViaEnvVar holds a map[Feature]bool
// with values explicitly set via env var
enabled atomic.Value
enabledViaEnvVar atomic.Value
// lockEnabledViaSetMethod protects enabledViaSetMethod
lockEnabledViaSetMethod sync.RWMutex
// enabledViaSetMethod holds values explicitly set
// via Set method, features stored in this map take
// precedence over features stored in enabledViaEnvVar
enabledViaSetMethod map[Feature]bool
// readEnvVars holds the boolean value which
// indicates whether readEnvVarsOnce has been called.
readEnvVars atomic.Bool
}
// Enabled returns true if the key is enabled. If the key is not known, this call will panic.
// Enabled returns true if the key is enabled. If the key is not known, this call will panic.
func (f *envVarFeatureGates) Enabled(key Feature) bool {
if v, ok := f.wasFeatureEnabledViaSetMethod(key); ok {
// ensue that the state of all known features
// is loaded from environment variables
// on the first call to Enabled method.
if !f.hasAlreadyReadEnvVar() {
_ = f.getEnabledMapFromEnvVar()
}
return v
}
if v, ok := f.getEnabledMapFromEnvVar()[key]; ok {
return v
}
@@ -94,6 +116,26 @@ func (f *envVarFeatureGates) Enabled(key Feature) bool {
panic(fmt.Errorf("feature %q is not registered in FeatureGates %q", key, f.callSiteName))
}
// Set sets the given feature to the given value.
//
// Features set via this method take precedence over
// the features set via environment variables.
func (f *envVarFeatureGates) Set(featureName Feature, featureValue bool) error {
feature, ok := f.known[featureName]
if !ok {
return fmt.Errorf("feature %q is not registered in FeatureGates %q", featureName, f.callSiteName)
}
if feature.LockToDefault && feature.Default != featureValue {
return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", featureName, featureValue, feature.Default)
}
f.lockEnabledViaSetMethod.Lock()
defer f.lockEnabledViaSetMethod.Unlock()
f.enabledViaSetMethod[featureName] = featureValue
return nil
}
// getEnabledMapFromEnvVar will fill the enabled map on the first call.
// This is the only time a known feature can be set to a value
// read from the corresponding environmental variable.
@@ -119,7 +161,7 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
featureGatesState[feature] = boolVal
}
}
f.enabled.Store(featureGatesState)
f.enabledViaEnvVar.Store(featureGatesState)
f.readEnvVars.Store(true)
for feature, featureSpec := range f.known {
@@ -130,7 +172,15 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool {
klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default)
}
})
return f.enabled.Load().(map[Feature]bool)
return f.enabledViaEnvVar.Load().(map[Feature]bool)
}
func (f *envVarFeatureGates) wasFeatureEnabledViaSetMethod(key Feature) (bool, bool) {
f.lockEnabledViaSetMethod.RLock()
defer f.lockEnabledViaSetMethod.RUnlock()
value, found := f.enabledViaSetMethod[key]
return value, found
}
func (f *envVarFeatureGates) hasAlreadyReadEnvVar() bool {

View File

@@ -23,21 +23,21 @@ import (
"github.com/stretchr/testify/require"
)
func TestEnvVarFeatureGates(t *testing.T) {
defaultTestFeatures := map[Feature]FeatureSpec{
"TestAlpha": {
Default: false,
LockToDefault: false,
PreRelease: "Alpha",
},
"TestBeta": {
Default: true,
LockToDefault: false,
PreRelease: "Beta",
},
}
expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true}
var defaultTestFeatures = map[Feature]FeatureSpec{
"TestAlpha": {
Default: false,
LockToDefault: false,
PreRelease: "Alpha",
},
"TestBeta": {
Default: true,
LockToDefault: false,
PreRelease: "Beta",
},
}
func TestEnvVarFeatureGates(t *testing.T) {
expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true}
copyExpectedStateMap := func(toCopy map[Feature]bool) map[Feature]bool {
m := map[Feature]bool{}
for k, v := range toCopy {
@@ -47,11 +47,14 @@ func TestEnvVarFeatureGates(t *testing.T) {
}
scenarios := []struct {
name string
features map[Feature]FeatureSpec
envVariables map[string]string
expectedFeaturesState map[Feature]bool
expectedInternalEnabledFeatureState map[Feature]bool
name string
features map[Feature]FeatureSpec
envVariables map[string]string
setMethodFeatures map[Feature]bool
expectedFeaturesState map[Feature]bool
expectedInternalEnabledViaEnvVarFeatureState map[Feature]bool
expectedInternalEnabledViaSetMethodFeatureState map[Feature]bool
}{
{
name: "can add empty features",
@@ -76,7 +79,7 @@ func TestEnvVarFeatureGates(t *testing.T) {
expectedDefaultFeaturesStateCopy["TestAlpha"] = true
return expectedDefaultFeaturesStateCopy
}(),
expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true},
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
},
{
name: "incorrect env var value gets ignored",
@@ -111,9 +114,25 @@ func TestEnvVarFeatureGates(t *testing.T) {
PreRelease: "Alpha",
},
},
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true},
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
},
{
name: "setting a feature via the Set method works",
features: defaultTestFeatures,
setMethodFeatures: map[Feature]bool{"TestAlpha": true},
expectedFeaturesState: map[Feature]bool{"TestAlpha": true},
expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": true},
},
{
name: "setting a feature via the Set method wins",
features: defaultTestFeatures,
setMethodFeatures: map[Feature]bool{"TestAlpha": false},
envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"},
expectedFeaturesState: map[Feature]bool{"TestAlpha": false},
expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true},
expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": false},
},
}
for _, scenario := range scenarios {
@@ -123,20 +142,33 @@ func TestEnvVarFeatureGates(t *testing.T) {
}
target := newEnvVarFeatureGates(scenario.features)
for k, v := range scenario.setMethodFeatures {
err := target.Set(k, v)
require.NoError(t, err)
}
for expectedFeature, expectedValue := range scenario.expectedFeaturesState {
actualValue := target.Enabled(expectedFeature)
require.Equal(t, actualValue, expectedValue, "expected feature=%v, to be=%v, not=%v", expectedFeature, expectedValue, actualValue)
}
enabledInternalMap := target.enabled.Load().(map[Feature]bool)
require.Len(t, enabledInternalMap, len(scenario.expectedInternalEnabledFeatureState))
enabledViaEnvVarInternalMap := target.enabledViaEnvVar.Load().(map[Feature]bool)
require.Len(t, enabledViaEnvVarInternalMap, len(scenario.expectedInternalEnabledViaEnvVarFeatureState))
for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaEnvVarFeatureState {
actualFeatureValue, wasExpectedFeatureFound := enabledViaEnvVarInternalMap[expectedFeatureName]
if !wasExpectedFeatureFound {
t.Errorf("feature %v has not been found in enabledViaEnvVarInternalMap", expectedFeatureName)
}
require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue)
}
for expectedFeature, expectedInternalPresence := range scenario.expectedInternalEnabledFeatureState {
featureInternalValue, featureSet := enabledInternalMap[expectedFeature]
require.Equal(t, expectedInternalPresence, featureSet, "feature %v present = %v, expected = %v", expectedFeature, featureSet, expectedInternalPresence)
expectedFeatureInternalValue := scenario.expectedFeaturesState[expectedFeature]
require.Equal(t, expectedFeatureInternalValue, featureInternalValue)
enabledViaSetMethodInternalMap := target.enabledViaSetMethod
require.Len(t, enabledViaSetMethodInternalMap, len(scenario.expectedInternalEnabledViaSetMethodFeatureState))
for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaSetMethodFeatureState {
actualFeatureValue, wasExpectedFeatureFound := enabledViaSetMethodInternalMap[expectedFeatureName]
if !wasExpectedFeatureFound {
t.Errorf("feature %v has not been found in enabledViaSetMethod", expectedFeatureName)
}
require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue)
}
})
}
@@ -154,3 +186,48 @@ func TestHasAlreadyReadEnvVar(t *testing.T) {
_ = target.getEnabledMapFromEnvVar()
require.True(t, target.hasAlreadyReadEnvVar())
}
func TestEnvVarFeatureGatesSetNegative(t *testing.T) {
scenarios := []struct {
name string
features map[Feature]FeatureSpec
featureName Feature
featureValue bool
expectedErr func(string) error
}{
{
name: "empty feature name returns an error",
features: defaultTestFeatures,
expectedErr: func(callSiteName string) error {
return fmt.Errorf("feature %q is not registered in FeatureGates %q", "", callSiteName)
},
},
{
name: "setting unknown feature returns an error",
features: defaultTestFeatures,
featureName: "Unknown",
expectedErr: func(callSiteName string) error {
return fmt.Errorf("feature %q is not registered in FeatureGates %q", "Unknown", callSiteName)
},
},
{
name: "setting locked feature returns an error",
features: map[Feature]FeatureSpec{"LockedFeature": {LockToDefault: true, Default: true}},
featureName: "LockedFeature",
featureValue: false,
expectedErr: func(_ string) error {
return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", "LockedFeature", false, true)
},
},
}
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
target := newEnvVarFeatureGates(scenario.features)
err := target.Set(scenario.featureName, scenario.featureValue)
require.Equal(t, scenario.expectedErr(target.callSiteName), err)
})
}
}

View File

@@ -30,6 +30,15 @@ func TestAddFeaturesToExistingFeatureGates(t *testing.T) {
require.Equal(t, defaultKubernetesFeatureGates, fakeFeatureGates.specs)
}
func TestReplaceFeatureGatesWithWarningIndicator(t *testing.T) {
defaultFeatureGates := FeatureGates()
require.Panics(t, func() { defaultFeatureGates.Enabled("Foo") }, "reading an unregistered feature gate Foo should panic")
if !replaceFeatureGatesWithWarningIndicator(defaultFeatureGates) {
t.Error("replacing the default feature gates after reading a value hasn't produced a warning")
}
}
type fakeRegistry struct {
specs map[Feature]FeatureSpec
}

View File

@@ -0,0 +1,90 @@
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package testing
import (
"fmt"
"strings"
"sync"
"testing"
clientfeatures "k8s.io/client-go/features"
)
var (
overriddenFeaturesLock sync.Mutex
overriddenFeatures map[clientfeatures.Feature]string
)
func init() {
overriddenFeatures = map[clientfeatures.Feature]string{}
}
type featureGatesSetter interface {
clientfeatures.Gates
Set(clientfeatures.Feature, bool) error
}
// SetFeatureDuringTest sets the specified feature to the specified value for the duration of the test.
//
// Example use:
//
// clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true)
func SetFeatureDuringTest(tb testing.TB, feature clientfeatures.Feature, featureValue bool) {
if err := setFeatureDuringTestInternal(tb, feature, featureValue); err != nil {
tb.Fatal(err)
}
}
func setFeatureDuringTestInternal(tb testing.TB, feature clientfeatures.Feature, featureValue bool) error {
overriddenFeaturesLock.Lock()
defer overriddenFeaturesLock.Unlock()
currentFeatureGates := clientfeatures.FeatureGates()
featureGates, ok := currentFeatureGates.(featureGatesSetter)
if !ok {
panic(fmt.Errorf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", currentFeatureGates))
}
originalFeatureValue := featureGates.Enabled(feature)
if overridingTestName, ok := overriddenFeatures[feature]; ok {
if !sameTestOrSubtest(tb, overridingTestName) {
return fmt.Errorf("client-go feature %q is currently overridden by %q test and cannot be also modified by %q", feature, overridingTestName, tb.Name())
}
}
if err := featureGates.Set(feature, featureValue); err != nil {
return err
}
overriddenFeatures[feature] = tb.Name()
tb.Cleanup(func() {
overriddenFeaturesLock.Lock()
defer overriddenFeaturesLock.Unlock()
delete(overriddenFeatures, feature)
if err := featureGates.Set(feature, originalFeatureValue); err != nil {
tb.Errorf("failed restoring client-go feature: %v to its original value: %v, err: %v", feature, originalFeatureValue, err)
}
})
return nil
}
// copied from component-base/featuregate/testing
func sameTestOrSubtest(tb testing.TB, testName string) bool {
return tb.Name() == testName || strings.HasPrefix(tb.Name(), testName+"/")
}

View File

@@ -30,24 +30,123 @@ func TestDriveInitDefaultFeatureGates(t *testing.T) {
featureGates := features.FeatureGates()
assertFunctionPanicsWithMessage(t, func() { featureGates.Enabled("FakeFeatureGate") }, "features.FeatureGates().Enabled", fmt.Sprintf("feature %q is not registered in FeatureGate", "FakeFeatureGate"))
fakeFeatureGates := &alwaysEnabledFakeGates{}
require.True(t, fakeFeatureGates.Enabled("FakeFeatureGate"))
fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}}
require.True(t, fakeGates.Enabled("FakeFeatureGate"))
features.ReplaceFeatureGates(fakeFeatureGates)
features.ReplaceFeatureGates(fakeGates)
featureGates = features.FeatureGates()
assertFeatureGatesType(t, featureGates)
require.True(t, featureGates.Enabled("FakeFeatureGate"))
}
type alwaysEnabledFakeGates struct{}
func TestSetFeatureGatesDuringTest(t *testing.T) {
featureA := features.Feature("FeatureA")
featureB := features.Feature("FeatureB")
fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true, featureB: true}}
features.ReplaceFeatureGates(fakeGates)
t.Cleanup(func() {
// since cleanup functions will be called in last added, first called order.
// check if the original feature wasn't restored
require.True(t, features.FeatureGates().Enabled(featureA), "the original feature = %v wasn't restored", featureA)
})
func (f *alwaysEnabledFakeGates) Enabled(features.Feature) bool {
return true
SetFeatureDuringTest(t, featureA, false)
require.False(t, features.FeatureGates().Enabled(featureA))
require.True(t, features.FeatureGates().Enabled(featureB))
}
func TestSetFeatureGatesDuringTestPanics(t *testing.T) {
fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}}
features.ReplaceFeatureGates(fakeGates)
assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "UnknownFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("feature %q is not registered in featureGates", "UnknownFeature"))
readOnlyGates := &readOnlyAlwaysDisabledFeatureGates{}
features.ReplaceFeatureGates(readOnlyGates)
assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "FakeFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", readOnlyGates))
}
func TestOverridesForSetFeatureGatesDuringTest(t *testing.T) {
scenarios := []struct {
name string
firstTestName string
secondTestName string
expectError bool
}{
{
name: "concurrent tests setting the same feature fail",
firstTestName: "fooTest",
secondTestName: "barTest",
expectError: true,
},
{
name: "same test setting the same feature does not fail",
firstTestName: "fooTest",
secondTestName: "fooTest",
expectError: false,
},
{
name: "subtests setting the same feature don't not fail",
firstTestName: "fooTest",
secondTestName: "fooTest/scenario1",
expectError: false,
},
}
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {
featureA := features.Feature("FeatureA")
fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true}}
fakeTesting := &fakeT{fakeTestName: scenario.firstTestName, TB: t}
features.ReplaceFeatureGates(fakeGates)
require.NoError(t, setFeatureDuringTestInternal(fakeTesting, featureA, true))
require.True(t, features.FeatureGates().Enabled(featureA))
fakeTesting.fakeTestName = scenario.secondTestName
err := setFeatureDuringTestInternal(fakeTesting, featureA, false)
require.Equal(t, scenario.expectError, err != nil)
})
}
}
type fakeFeatureGates struct {
features map[features.Feature]bool
}
func (f *fakeFeatureGates) Enabled(feature features.Feature) bool {
featureValue, ok := f.features[feature]
if !ok {
panic(fmt.Errorf("feature %q is not registered in featureGates", feature))
}
return featureValue
}
func (f *fakeFeatureGates) Set(feature features.Feature, value bool) error {
f.features[feature] = value
return nil
}
type readOnlyAlwaysDisabledFeatureGates struct{}
func (f *readOnlyAlwaysDisabledFeatureGates) Enabled(feature features.Feature) bool {
return false
}
type fakeT struct {
fakeTestName string
testing.TB
}
func (t *fakeT) Name() string {
return t.fakeTestName
}
func assertFeatureGatesType(t *testing.T, fg features.Gates) {
_, ok := fg.(*alwaysEnabledFakeGates)
_, ok := fg.(*fakeFeatureGates)
if !ok {
t.Fatalf("passed features.FeatureGates() is NOT of type *alwaysEnabledFakeGates, it is of type = %T", fg)
}

35
go.mod
View File

@@ -5,45 +5,45 @@ module k8s.io/client-go
go 1.22.0
require (
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/gogo/protobuf v1.3.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/protobuf v1.5.4
github.com/google/gnostic-models v0.6.8
github.com/google/go-cmp v0.6.0
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/gorilla/websocket v1.5.0
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/imdario/mergo v0.3.6
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.23.0
golang.org/x/oauth2 v0.10.0
golang.org/x/term v0.18.0
go.uber.org/goleak v1.3.0
golang.org/x/net v0.25.0
golang.org/x/oauth2 v0.20.0
golang.org/x/term v0.20.0
golang.org/x/time v0.3.0
google.golang.org/protobuf v1.33.0
k8s.io/api v0.30.12
k8s.io/apimachinery v0.30.12
gopkg.in/evanphx/json-patch.v4 v4.12.0
k8s.io/api v0.31.0-alpha.2
k8s.io/apimachinery v0.31.0-alpha.2
k8s.io/klog/v2 v2.120.1
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
sigs.k8s.io/yaml v1.3.0
sigs.k8s.io/yaml v1.4.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0-beta // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
@@ -52,13 +52,12 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
github.com/onsi/gomega v1.33.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

90
go.sum
View File

@@ -1,31 +1,29 @@
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fxamacker/cbor/v2 v2.7.0-beta h1:m5bO941uTVpSms26QjzEJxUZaC3S/h1pSJexBCu4wAA=
github.com/fxamacker/cbor/v2 v2.7.0-beta/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
@@ -38,16 +36,15 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec=
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM=
github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
@@ -76,81 +73,82 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY=
github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM=
github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE=
github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk=
github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw=
golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -159,10 +157,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.30.12 h1:gZlrUQI9LczOsWHWorRVDkXGfeN7+UhMFSO7bDsMNUg=
k8s.io/api v0.30.12/go.mod h1:xKCbuTXdNDMamnT1hdl/37kzCtpzzErsOj3DFrtvMtQ=
k8s.io/apimachinery v0.30.12 h1:41DC/4aa9twnQGBShHxh/LFoc7F4chsGBG/P2TW+J0Q=
k8s.io/apimachinery v0.30.12/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/api v0.31.0-alpha.2 h1:azMbpAFERqtGmgDtg/f7efnxgPBW+8ieyHNKxT97EMI=
k8s.io/api v0.31.0-alpha.2/go.mod h1:S1X5UjUV8NZmR1vmKIkUpruhr0AWAvocZVZ5zxKMvi4=
k8s.io/apimachinery v0.31.0-alpha.2 h1:jya7Ax6yRLH+CSW/osUEO+hxe4rVNrXU8lNB0fZcGkk=
k8s.io/apimachinery v0.31.0-alpha.2/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
@@ -173,5 +171,5 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=

View File

@@ -43,20 +43,22 @@ var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Mutating
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.MutatingWebhookConfiguration), err
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
emptyResult := &v1.MutatingWebhookConfigurationList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1.MutatingWebhookConfigurationList{})
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts meta
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.MutatingWebhookConfiguration), err
}
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.MutatingWebhookConfiguration), err
}
@@ -115,10 +119,11 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.MutatingWebhookConfiguration), err
}
@@ -136,10 +141,11 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW
if name == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
}
emptyResult := &v1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.MutatingWebhookConfiguration), err
}

View File

@@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("Validating
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1.ValidatingAdmissionPolicyList{})
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) {
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
@@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context,
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
@@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}
@@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicy), err
}

View File

@@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("Vali
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyBindingList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1.ValidatingAdmissionPolicyBindingList{})
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
}
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
}
@@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
}
@@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
}
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
}

View File

@@ -43,20 +43,22 @@ var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Valida
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingWebhookConfiguration), err
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
emptyResult := &v1.ValidatingWebhookConfigurationList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1.ValidatingWebhookConfigurationList{})
Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts me
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingWebhookConfiguration), err
}
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingWebhookConfiguration), err
}
@@ -115,10 +119,11 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingWebhookConfiguration), err
}
@@ -136,10 +141,11 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat
if name == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
}
emptyResult := &v1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ValidatingWebhookConfiguration), err
}

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface.
@@ -78,7 +81,26 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations
func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.MutatingWebhookConfigurationList{}
err = c.client.Get().
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@@ -80,7 +83,26 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -95,6 +117,22 @@ func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.List
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@@ -78,7 +81,26 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface.
@@ -78,7 +81,26 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string,
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations
func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ValidatingWebhookConfigurationList{}
err = c.client.Get().
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("Vali
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1alpha1.ValidatingAdmissionPolicyList{})
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.Lis
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) {
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
@@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context,
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
@@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}
@@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
}

View File

@@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1alpha1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1alpha1.ValidatingAdmissionPolicyBindingList{})
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1alpha1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
}
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1alpha1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
}
@@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1alpha1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
}
@@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
}
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1alpha1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
}

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@@ -80,7 +83,26 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -95,6 +117,22 @@ func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@@ -78,7 +81,26 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -43,20 +43,22 @@ var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("Mut
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1beta1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
emptyResult := &v1beta1.MutatingWebhookConfigurationList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1beta1.MutatingWebhookConfigurationList{})
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.L
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
@@ -115,10 +119,11 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
@@ -136,10 +141,11 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW
if name == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
}
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.MutatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}

View File

@@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("Valid
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1beta1.ValidatingAdmissionPolicyList{})
Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.Lis
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) {
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
@@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context,
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
@@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}
@@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
}
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.ValidatingAdmissionPolicy{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
}

View File

@@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind(
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1beta1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1beta1.ValidatingAdmissionPolicyBindingList{})
Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
}
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
}
@@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
}
@@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid
if name == nil {
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
}
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicyBinding{})
Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
}

View File

@@ -43,20 +43,22 @@ var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("V
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
emptyResult := &v1beta1.ValidatingWebhookConfigurationList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1beta1.ValidatingWebhookConfigurationList{})
Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,20 +82,22 @@ func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
@@ -115,10 +119,11 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
@@ -136,10 +141,11 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat
if name == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
}
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingWebhookConfiguration{})
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface.
@@ -78,7 +81,26 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op
}
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOp
return
}
// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations
func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.MutatingWebhookConfigurationList{}
err = c.client.Get().
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface.
@@ -80,7 +83,26 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -95,6 +117,22 @@ func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOpti
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies
func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingAdmissionPolicyList{}
err = c.client.Get().
Resource("validatingadmissionpolicies").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface.
@@ -78,7 +81,26 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string
}
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.Li
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings
func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingAdmissionPolicyBindingList{}
err = c.client.Get().
Resource("validatingadmissionpolicybindings").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface.
@@ -78,7 +81,26 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string,
}
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
func (c *validatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -93,6 +115,22 @@ func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.List
return
}
// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations
func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ValidatingWebhookConfigurationList{}
err = c.client.Get().
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -43,20 +43,22 @@ var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion")
// Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any.
func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) {
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(storageversionsResource, name), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootGetAction(storageversionsResource, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
// List takes label and field selectors, and returns the list of StorageVersions that match those selectors.
func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
emptyResult := &v1alpha1.StorageVersionList{}
obj, err := c.Fake.
Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), &v1alpha1.StorageVersionList{})
Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -80,31 +82,34 @@ func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (w
// Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any.
func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) {
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
// Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any.
func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) {
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) {
func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) {
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
@@ -126,10 +131,11 @@ func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.Dele
// Patch applies the patch and returns the patched storageVersion.
func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) {
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
@@ -147,10 +153,11 @@ func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserv
if name == nil {
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
}
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}
@@ -169,10 +176,11 @@ func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *a
if name == nil {
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
}
emptyResult := &v1alpha1.StorageVersion{}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersion{})
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.StorageVersion), err
}

View File

@@ -31,6 +31,9 @@ import (
apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StorageVersionsGetter has a method to return a StorageVersionInterface.
@@ -80,7 +83,26 @@ func (c *storageVersions) Get(ctx context.Context, name string, options v1.GetOp
}
// List takes label and field selectors, and returns the list of StorageVersions that match those selectors.
func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for storageversions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversions", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for storageversions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StorageVersions that match those selectors.
func (c *storageVersions) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -95,6 +117,22 @@ func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of StorageVersions
func (c *storageVersions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.StorageVersionList{}
err = c.client.Get().
Resource("storageversions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested storageVersions.
func (c *storageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@@ -81,7 +84,26 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options meta
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -97,6 +119,23 @@ func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions)
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@@ -83,7 +86,26 @@ func (c *daemonSets) Get(ctx context.Context, name string, options metav1.GetOpt
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of DaemonSets
func (c *daemonSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -33,6 +33,9 @@ import (
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@@ -89,7 +92,26 @@ func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -105,6 +127,23 @@ func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) {
emptyResult := &v1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1.ControllerRevision{})
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ControllerRevision), err
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
emptyResult := &v1.ControllerRevisionList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1.ControllerRevisionList{})
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOpt
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) {
emptyResult := &v1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1.ControllerRevision{})
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ControllerRevision), err
}
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) {
emptyResult := &v1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1.ControllerRevision{})
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ControllerRevision), err
}
@@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts met
// Patch applies the patch and returns the patched controllerRevision.
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) {
emptyResult := &v1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ControllerRevision), err
}
@@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
emptyResult := &v1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ControllerRevision), err
}

View File

@@ -44,22 +44,24 @@ var daemonsetsKind = v1.SchemeGroupVersion.WithKind("DaemonSet")
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) {
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1.DaemonSet{})
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
emptyResult := &v1.DaemonSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1.DaemonSetList{})
Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (wa
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) {
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1.DaemonSet{})
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) {
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1.DaemonSet{})
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) {
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) {
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1.DaemonSet{})
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
@@ -134,11 +139,12 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.Delet
// Patch applies the patch and returns the patched daemonSet.
func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) {
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
@@ -156,11 +162,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetA
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}
@@ -179,11 +186,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.Daem
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
emptyResult := &v1.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.DaemonSet), err
}

View File

@@ -46,22 +46,24 @@ var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment")
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) {
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1.Deployment{})
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
emptyResult := &v1.DeploymentList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1.DeploymentList{})
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -86,34 +88,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (w
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) {
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1.Deployment{})
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) {
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1.Deployment{})
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) {
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) {
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1.Deployment{})
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
@@ -136,11 +141,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.Dele
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) {
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
@@ -158,11 +164,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.Deployme
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
@@ -181,33 +188,36 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.De
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &autoscalingv1.Scale{})
Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &autoscalingv1.Scale{})
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
@@ -222,11 +232,12 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string,
if err != nil {
return nil, err
}
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}

View File

@@ -46,22 +46,24 @@ var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet")
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) {
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1.ReplicaSet{})
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
emptyResult := &v1.ReplicaSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1.ReplicaSetList{})
Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -86,34 +88,37 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (w
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) {
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1.ReplicaSet{})
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) {
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1.ReplicaSet{})
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) {
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) {
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1.ReplicaSet{})
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
@@ -136,11 +141,12 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.Dele
// Patch applies the patch and returns the patched replicaSet.
func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) {
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
@@ -158,11 +164,12 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaS
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
@@ -181,33 +188,36 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.Re
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
emptyResult := &v1.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &autoscalingv1.Scale{})
Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{})
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
@@ -222,11 +232,12 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string,
if err != nil {
return nil, err
}
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}

View File

@@ -46,22 +46,24 @@ var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet")
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) {
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1.StatefulSet{})
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
emptyResult := &v1.StatefulSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1.StatefulSetList{})
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -86,34 +88,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) {
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1.StatefulSet{})
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) {
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1.StatefulSet{})
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) {
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) {
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1.StatefulSet{})
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
@@ -136,11 +141,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.Del
// Patch applies the patch and returns the patched statefulSet.
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) {
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
@@ -158,11 +164,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.Statef
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
@@ -181,33 +188,36 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1.
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &autoscalingv1.Scale{})
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{})
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}
@@ -222,11 +232,12 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin
if err != nil {
return nil, err
}
emptyResult := &autoscalingv1.Scale{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*autoscalingv1.Scale), err
}

View File

@@ -33,6 +33,9 @@ import (
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
@@ -89,7 +92,26 @@ func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOp
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -105,6 +127,23 @@ func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicaSets
func (c *replicaSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ReplicaSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *replicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -33,6 +33,9 @@ import (
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@@ -89,7 +92,26 @@ func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetO
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -105,6 +127,23 @@ func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (resul
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@@ -81,7 +84,26 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -97,6 +119,23 @@ func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@@ -83,7 +86,26 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRev
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) {
emptyResult := &v1beta1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta1.ControllerRevision{})
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ControllerRevision), err
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
emptyResult := &v1beta1.ControllerRevisionList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta1.ControllerRevisionList{})
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) {
emptyResult := &v1beta1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{})
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ControllerRevision), err
}
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) {
emptyResult := &v1beta1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{})
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ControllerRevision), err
}
@@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.
// Patch applies the patch and returns the patched controllerRevision.
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) {
emptyResult := &v1beta1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta1.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ControllerRevision), err
}
@@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
emptyResult := &v1beta1.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.ControllerRevision), err
}

View File

@@ -44,22 +44,24 @@ var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment")
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) {
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
emptyResult := &v1beta1.DeploymentList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{})
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) {
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) {
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) {
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) {
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
@@ -134,11 +139,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) {
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
@@ -156,11 +162,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.Dep
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}
@@ -179,11 +186,12 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1beta1.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.Deployment), err
}

View File

@@ -44,22 +44,24 @@ var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet")
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) {
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
emptyResult := &v1beta1.StatefulSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta1.StatefulSetList{})
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) {
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) {
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) {
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) {
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
@@ -134,11 +139,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO
// Patch applies the patch and returns the patched statefulSet.
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) {
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
@@ -156,11 +162,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.S
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}
@@ -179,11 +186,12 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1beta1.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.StatefulSet), err
}

View File

@@ -31,6 +31,9 @@ import (
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@@ -83,7 +86,26 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ControllerRevisionsGetter has a method to return a ControllerRevisionInterface.
@@ -81,7 +84,26 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -97,6 +119,23 @@ func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (re
return
}
// watchList establishes a watch stream with the server and returns the list of ControllerRevisions
func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ControllerRevisionList{}
err = c.client.Get().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested controllerRevisions.
func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
@@ -83,7 +86,26 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1b
return
}
// watchList establishes a watch stream with the server and returns the list of DaemonSets
func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// DeploymentsGetter has a method to return a DeploymentInterface.
@@ -83,7 +86,26 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of Deployments
func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.DeploymentList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRev
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) {
emptyResult := &v1beta2.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{})
Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ControllerRevision), err
}
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
emptyResult := &v1beta2.ControllerRevisionList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta2.ControllerRevisionList{})
Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) {
emptyResult := &v1beta2.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{})
Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ControllerRevision), err
}
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) {
emptyResult := &v1beta2.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{})
Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ControllerRevision), err
}
@@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.
// Patch applies the patch and returns the patched controllerRevision.
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) {
emptyResult := &v1beta2.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta2.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ControllerRevision), err
}
@@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
emptyResult := &v1beta2.ControllerRevision{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ControllerRevision{})
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ControllerRevision), err
}

View File

@@ -44,22 +44,24 @@ var daemonsetsKind = v1beta2.SchemeGroupVersion.WithKind("DaemonSet")
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) {
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta2.DaemonSet{})
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
emptyResult := &v1beta2.DaemonSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1beta2.DaemonSetList{})
Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) {
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{})
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) {
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{})
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) {
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) {
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta2.DaemonSet{})
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
@@ -134,11 +139,12 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOpt
// Patch applies the patch and returns the patched daemonSet.
func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) {
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
@@ -156,11 +162,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.Daemo
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}
@@ -179,11 +186,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.DaemonSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.DaemonSet), err
}

View File

@@ -44,22 +44,24 @@ var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment")
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) {
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta2.Deployment{})
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
emptyResult := &v1beta2.DeploymentList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta2.DeploymentList{})
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) {
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{})
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) {
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{})
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) {
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) {
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta2.Deployment{})
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
@@ -134,11 +139,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) {
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta2.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
@@ -156,11 +162,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.Dep
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}
@@ -179,11 +186,12 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
emptyResult := &v1beta2.Deployment{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Deployment), err
}

View File

@@ -44,22 +44,24 @@ var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet")
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) {
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta2.ReplicaSet{})
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
emptyResult := &v1beta2.ReplicaSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta2.ReplicaSetList{})
Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) {
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{})
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) {
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{})
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) {
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) {
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta2.ReplicaSet{})
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
@@ -134,11 +139,12 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOp
// Patch applies the patch and returns the patched replicaSet.
func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) {
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1beta2.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
@@ -156,11 +162,12 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.Rep
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}
@@ -179,11 +186,12 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1bet
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.ReplicaSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.ReplicaSet), err
}

View File

@@ -44,22 +44,24 @@ var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet")
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) {
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta2.StatefulSet{})
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
emptyResult := &v1beta2.StatefulSetList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta2.StatefulSetList{})
Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) {
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{})
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) {
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{})
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) {
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) {
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta2.StatefulSet{})
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
@@ -134,11 +139,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO
// Patch applies the patch and returns the patched statefulSet.
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) {
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
@@ -156,11 +162,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.S
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
@@ -179,33 +186,36 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
emptyResult := &v1beta2.StatefulSet{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
emptyResult := &v1beta2.Scale{}
obj, err := c.Fake.
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &v1beta2.Scale{})
Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Scale), err
}
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) {
emptyResult := &v1beta2.Scale{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &v1beta2.Scale{})
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Scale), err
}
@@ -220,11 +230,12 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin
if err != nil {
return nil, err
}
emptyResult := &v1beta2.Scale{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &v1beta2.Scale{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta2.Scale), err
}

View File

@@ -31,6 +31,9 @@ import (
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
@@ -83,7 +86,26 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption
}
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1
return
}
// watchList establishes a watch stream with the server and returns the list of ReplicaSets
func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.ReplicaSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// StatefulSetsGetter has a method to return a StatefulSetInterface.
@@ -87,7 +90,26 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio
}
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of StatefulSets that match those selectors.
func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -103,6 +125,23 @@ func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of StatefulSets
func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta2.StatefulSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview")
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) {
emptyResult := &v1.SelfSubjectReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1.SelfSubjectReview{})
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.SelfSubjectReview), err
}

View File

@@ -37,10 +37,11 @@ var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview")
// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any.
func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) {
emptyResult := &v1.TokenReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1.TokenReview{})
Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.TokenReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectRe
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) {
emptyResult := &v1alpha1.SelfSubjectReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1alpha1.SelfSubjectReview{})
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1alpha1.SelfSubjectReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectRev
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) {
emptyResult := &v1beta1.SelfSubjectReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1beta1.SelfSubjectReview{})
Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.SelfSubjectReview), err
}

View File

@@ -37,10 +37,11 @@ var tokenreviewsKind = v1beta1.SchemeGroupVersion.WithKind("TokenReview")
// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any.
func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) {
emptyResult := &v1beta1.TokenReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1beta1.TokenReview{})
Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.TokenReview), err
}

View File

@@ -38,11 +38,12 @@ var localsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("LocalSubject
// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any.
func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) {
emptyResult := &v1.LocalSubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1.LocalSubjectAccessReview{})
Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.LocalSubjectAccessReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAc
// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any.
func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) {
emptyResult := &v1.SelfSubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1.SelfSubjectAccessReview{})
Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.SelfSubjectAccessReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectrulesreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectRul
// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any.
func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) {
emptyResult := &v1.SelfSubjectRulesReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1.SelfSubjectRulesReview{})
Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.SelfSubjectRulesReview), err
}

View File

@@ -37,10 +37,11 @@ var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessRevi
// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any.
func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) {
emptyResult := &v1.SubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1.SubjectAccessReview{})
Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.SubjectAccessReview), err
}

View File

@@ -38,11 +38,12 @@ var localsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("LocalSu
// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any.
func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) {
emptyResult := &v1beta1.LocalSubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1beta1.LocalSubjectAccessReview{})
Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.LocalSubjectAccessReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubj
// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any.
func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) {
emptyResult := &v1beta1.SelfSubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1beta1.SelfSubjectAccessReview{})
Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.SelfSubjectAccessReview), err
}

View File

@@ -37,10 +37,11 @@ var selfsubjectrulesreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubje
// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any.
func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) {
emptyResult := &v1beta1.SelfSubjectRulesReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1beta1.SelfSubjectRulesReview{})
Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.SelfSubjectRulesReview), err
}

View File

@@ -37,10 +37,11 @@ var subjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SubjectAcces
// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any.
func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) {
emptyResult := &v1beta1.SubjectAccessReview{}
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1beta1.SubjectAccessReview{})
Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1beta1.SubjectAccessReview), err
}

View File

@@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v1.SchemeGroupVersion.WithKind("HorizontalPod
// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) {
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
emptyResult := &v1.HorizontalPodAutoscalerList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.Li
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) {
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) {
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) {
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) {
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
@@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) {
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
@@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}
@@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.HorizontalPodAutoscaler), err
}

View File

@@ -31,6 +31,9 @@ import (
autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@@ -83,7 +86,26 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOpt
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2.SchemeGroupVersion.WithKind("HorizontalPod
// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
emptyResult := &v2.HorizontalPodAutoscalerList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) {
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
@@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
@@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}
@@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2.HorizontalPodAutoscaler), err
}

View File

@@ -31,6 +31,9 @@ import (
autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@@ -83,7 +86,26 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2beta1.SchemeGroupVersion.WithKind("Horizont
// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscalerList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta1.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) {
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
@@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
@@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
@@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2beta1.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}

View File

@@ -31,6 +31,9 @@ import (
autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@@ -83,7 +86,26 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2beta1.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2beta2.SchemeGroupVersion.WithKind("Horizont
// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any.
func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscalerList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta2.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) {
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
@@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) {
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
@@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
@@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
emptyResult := &v2beta2.HorizontalPodAutoscaler{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta2.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}

View File

@@ -31,6 +31,9 @@ import (
autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface.
@@ -83,7 +86,26 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options
}
// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors.
func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions
return
}
// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers
func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2beta2.HorizontalPodAutoscalerList{}
err = c.client.Get().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -31,6 +31,9 @@ import (
batchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// CronJobsGetter has a method to return a CronJobInterface.
@@ -83,7 +86,26 @@ func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptio
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v
return
}
// watchList establishes a watch stream with the server and returns the list of CronJobs
func (c *cronJobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.CronJobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cronJobs.
func (c *cronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

View File

@@ -44,22 +44,24 @@ var cronjobsKind = v1.SchemeGroupVersion.WithKind("CronJob")
// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any.
func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) {
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v1.CronJob{})
Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
emptyResult := &v1.CronJobList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &v1.CronJobList{})
Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watc
// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) {
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v1.CronJob{})
Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) {
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v1.CronJob{})
Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) {
func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) {
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v1.CronJob{})
Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
@@ -134,11 +139,12 @@ func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteO
// Patch applies the patch and returns the patched cronJob.
func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) {
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &v1.CronJob{})
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
@@ -156,11 +162,12 @@ func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyC
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.CronJob{})
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}
@@ -179,11 +186,12 @@ func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJob
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
emptyResult := &v1.CronJob{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.CronJob{})
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.CronJob), err
}

View File

@@ -44,22 +44,24 @@ var jobsKind = v1.SchemeGroupVersion.WithKind("Job")
// Get takes name of the job, and returns the corresponding job object, and an error if there is any.
func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) {
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1.Job{})
Invokes(testing.NewGetAction(jobsResource, c.ns, name), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
emptyResult := &v1.JobList{}
obj, err := c.Fake.
Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &v1.JobList{})
Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
@@ -84,34 +86,37 @@ func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.In
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) {
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any.
func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) {
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) {
func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) {
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
@@ -134,11 +139,12 @@ func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) {
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &v1.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
@@ -156,11 +162,12 @@ func (c *FakeJobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}
@@ -179,11 +186,12 @@ func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfigu
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
emptyResult := &v1.Job{}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult)
if obj == nil {
return nil, err
return emptyResult, err
}
return obj.(*v1.Job), err
}

View File

@@ -31,6 +31,9 @@ import (
batchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
consistencydetector "k8s.io/client-go/util/consistencydetector"
watchlist "k8s.io/client-go/util/watchlist"
"k8s.io/klog/v2"
)
// JobsGetter has a method to return a JobInterface.
@@ -83,7 +86,26 @@ func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions)
}
// List takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) {
if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil {
klog.Warningf("Failed preparing watchlist options for jobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr)
} else if hasWatchListOptionsPrepared {
result, err := c.watchList(ctx, watchListOptions)
if err == nil {
consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for jobs", c.list, opts, result)
return result, nil
}
klog.Warningf("The watchlist request for jobs ended with an error, falling back to the standard LIST semantics, err = %v", err)
}
result, err := c.list(ctx, opts)
if err == nil {
consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result)
}
return result, err
}
// list takes label and field selectors, and returns the list of Jobs that match those selectors.
func (c *jobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -99,6 +121,23 @@ func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.Jo
return
}
// watchList establishes a watch stream with the server and returns the list of Jobs
func (c *jobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.JobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
WatchList(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested jobs.
func (c *jobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration

Some files were not shown because too many files have changed in this diff Show More