Compare commits

...

84 Commits

Author SHA1 Message Date
Kubernetes Publisher
146dcd5d6f Update dependencies to v0.18.9 tag 2020-09-16 20:12:02 +00:00
Kubernetes Publisher
4c2c810a97 Merge pull request #94426 from gobomb/automated-cherry-pick-of-#93646-origin-release-1.18
Automated cherry pick of #93646: let panics propagate up when processLoop panic

Kubernetes-commit: 9150263c8c7a42f3ae28e6e27a471d2697dfe5ed
2020-09-04 05:30:45 +00:00
Kubernetes Publisher
f3104ae88e Merge pull request #94430 from janeczku/automated-cherry-pick-of-#94316-upstream-release-1.18
Automated cherry pick of #94316: Fixed reflector not recovering from "Too large resource

Kubernetes-commit: abb70d04424848f39a771d04521822c81481b99b
2020-09-04 05:30:44 +00:00
Kubernetes Publisher
82b9b1a146 Merge pull request #94148 from liggitt/json-patch-1.18
[1.18] Update to json-patch 4.9.0

Kubernetes-commit: 62eff8d42cff51ddab6ef3c5b3f7380a5c02815f
2020-09-03 13:32:01 +00:00
janeczku
94230b73bd Fixed reflector not recovering from "Too large resource version" errors with API servers 1.17.0-1.18.5
Kubernetes-commit: 744dd65b388e9fc17f53072db35c38748a83e777
2020-08-28 21:17:27 +02:00
Jordan Liggitt
0b89f44804 Update json-patch to v4.9.0 tagged release
Kubernetes-commit: f28d1007a56fa23c1874b973fa0024eddffc6fac
2020-08-20 17:14:41 -04:00
Kubernetes Publisher
c8494005d1 Merge pull request #93811 from liggitt/json-patch-4.8.0-1.18
[1.18] Update to json-patch 4.8.0

Kubernetes-commit: 7914bac28a993d4493e0c1e31323bb9330dbdcf6
2020-08-12 05:30:03 +00:00
Jordan Liggitt
146c268590 Update to json-patch 4.8.0
Kubernetes-commit: b924a9330380fd993ad9ca4ebb171c1a67ecb51f
2020-08-08 09:59:16 -04:00
gobomb
ce358577b6 let panics propagate up when processLoop panic
Kubernetes-commit: 2474a2ebc8f953104b25b48c771596d57e918470
2020-08-03 09:30:39 +00:00
Kubernetes Publisher
9e5bcc7f62 Merge pull request #92688 from wojtek-t/automated-cherry-pick-of-#92537-upstream-release-1.18
Automated cherry pick of #92537 upstream release 1.18

Kubernetes-commit: 91ae197b9d0b13b8280992595d0556d118bf11dd
2020-07-09 05:07:02 +00:00
wojtekt
3ac0631eb9 Fix bug in reflector not recovering from "Too large resource version" errors
Kubernetes-commit: 8012722d626d50fd18059ec5af6d195a7dc180c1
2020-06-26 09:45:29 +02:00
Kubernetes Publisher
303c51f3d4 Merge pull request #89909 from howardjohn/automated-cherry-pick-of-#87821-upstream-release-1.18
[1.18 cherrypick] Check Annotations map against nil for ConfigMapLock#Update()

Kubernetes-commit: 7352cb49fb118471ac08bf49f496a6b623cd1bb9
2020-04-30 00:26:05 +00:00
Kubernetes Publisher
7b592a8174 Merge pull request #90019 from liggitt/json-raw-1.18
Manual cherry pick of #89833: preserve integers decoding raw JSON values

Kubernetes-commit: 1533a3d87f7c750263b07a426d47573e41bfd0d8
2020-04-29 12:28:12 +00:00
Kubernetes Publisher
11b3f81436 Merge pull request #90244 from soltysh/automated-cherry-pick-of-#90243-upstream-release-1.18
Automated cherry pick of #90243: Revert "stop defaulting kubeconfig to http://localhost:8080"

Kubernetes-commit: a19486ac03436191f9826c2058b98486dc9051c5
2020-04-28 13:44:39 -07:00
Maciej Szulik
19e102247d Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee.

Kubernetes-commit: b03bb751c21ac20f1d2b95e33487017a608cf45c
2020-04-17 16:37:15 +02:00
Kubernetes Publisher
b3ff053fb1 Merge pull request #89975 from liggitt/relist-timeout-1.18
Manual cherry pick of #89652: Fix client watch reestablishment handling of client-side timeouts

Kubernetes-commit: c37f8ac0e1f85be80ce3a91c0bf3f9869aaa200b
2020-04-10 02:42:27 +00:00
Jordan Liggitt
3ce1317b14 kube-openapi bump to release-1.18
Kubernetes-commit: 34726e1b50d1dd7de5972c824db566511813d8b7
2020-04-09 14:51:42 -04:00
Ted Yu
aa2d6328a3 Check Annotations map against nil for ConfigMapLock#Update()
Signed-off-by: Ted Yu <yuzhihong@gmail.com>

Kubernetes-commit: e9e1ea490f8e6f46730f847b2f48456098d94623
2020-04-03 16:47:19 -07:00
Jordan Liggitt
dbcb4c305c Fix client watch reestablishment handling of client-side timeouts
Kubernetes-commit: ea49e94be8a8b5285e1ea737df0bfd83e8b5158f
2020-03-30 10:36:01 -04:00
Kubernetes Publisher
88ba1c9b80 Merge pull request #89783 from weinong/automated-cherry-pick-of-#89706-upstream-release-1.18
Automated cherry pick of #89706: fix a bug where spn: prefix is unexpectedly added to

Kubernetes-commit: ec8c186fe8181f52670716d8d10aa7663e868491
2020-04-04 08:59:45 -07:00
Weinong Wang
136e483e70 fix a bug where spn: prefix is unexpectedly added to kubeconfig apiserver-id setting
Kubernetes-commit: 0c78c1e66e37b9c0c12284889a408ba5c667f321
2020-03-31 15:59:37 -07:00
Kubernetes Publisher
dc8515ba96 Merge pull request #89449 from saad-ali/automated-cherry-pick-of-#89444-upstream-release-1.18
Automated cherry pick of #89444 upstream release 1.18

Kubernetes-commit: 8be33caaf953ac6fdb5e57435363282e3098616c
2020-03-25 04:40:45 +00:00
Hemant Kumar
8ca7f667a2 bump k8s.io/utils package
This fixes bug with xfs mount failing because of xfs_repair
being called. Fixes https://github.com/kubernetes/utils/issues/141

Kubernetes-commit: 0630031f85ba508559abcb40a1adca4ac2350056
2020-03-24 17:21:19 -04:00
Kubernetes Publisher
3e3c7a4209 Merge pull request #89343 from aojea/automated-cherry-pick-of-#89341-upstream-release-1.18
Automated cherry pick of #89341: bump k8s.io utils

Kubernetes-commit: a4d1f873dd75a547dff75c9de77bc4dfabc5d4e6
2020-03-23 04:33:46 +00:00
Antonio Ojea
6be3e0bf76 bump k8s.io utils
Fix a bug in k8s.io/utils/net.GetIndexedIP() that wasn't working
with IPv6 addresses with leading zeros.

Kubernetes-commit: 0c34f5e431c7b0cdc8f41e39e6797422c63532cb
2020-03-22 22:21:47 +01:00
Kubernetes Publisher
d0229e78f4 Merge pull request #89331 from andyzhangx/automated-cherry-pick-of-#89319-upstream-release-1.18
Automated cherry pick of #89319: Update vendored MountSensitive code for Windows

Kubernetes-commit: 35d71ed91ceecb9b19d329a39d8553a273035895
2020-03-21 20:27:08 +00:00
marosset
63c6663c56 Updating vendored files
Kubernetes-commit: cf790a8d209cb61fe8a97b4947b556cdb77be015
2020-03-20 21:13:48 +00:00
Kubernetes Publisher
aad7e5b6d4 Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: 4345b892177bf918d49fea1876bfbe236e251734
2020-03-08 14:53:38 +00:00
Kubernetes Publisher
f6341befeb Merge pull request #88875 from apelisse/apply-no-op
SSA: Applying same object twice should be a no-op the second time

Kubernetes-commit: 71ad0a90205c12e8ebbe6872db30097026916659
2020-03-08 16:26:25 +00:00
Jordan Liggitt
1088ee5da1 client-go: add context/options to expansions methods
Kubernetes-commit: 4c034278f4ec022698eb2e8aae3dfcc08abebe89
2020-03-06 16:30:37 -05:00
Kubernetes Publisher
1979366505 Merge pull request #88910 from liggitt/metadata-context
Metadata client: plumb context

Kubernetes-commit: f52cbea102bb6ba9fe951cbf81e7dd4b48f95d9e
2020-03-08 16:26:24 +00:00
Kubernetes Publisher
1f8ca21aea Merge pull request #88906 from liggitt/dynamic-delete
Dynamic client: plumb context

Kubernetes-commit: cf4d797b5dddef1b1e06a50ebda8a0738e04b66c
2020-03-08 16:26:22 +00:00
Kubernetes Publisher
e686f3a6b1 Merge pull request #88599 from julianvmodesto/scale-ctx-opts
Add context and options to scale client

Kubernetes-commit: 179fe40d06bc07b0e6602b203a8fb8e722c4e2a4
2020-03-08 16:26:21 +00:00
Kubernetes Publisher
95caa2d638 Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: df00300353342181f7930d81c197f52b0d6164de
2020-03-06 17:09:23 +00:00
Jordan Liggitt
e21d8b321d client-go metadata: plumb context
Kubernetes-commit: cb4ee9334b744404e670ea2c28a3093a3cd67844
2020-03-06 10:42:18 -05:00
Christian Huffman
963287bf1b Updated files after rebase
Kubernetes-commit: d0890533a99bcb7f3ee173846863960d15064577
2020-03-06 08:56:59 -05:00
Jordan Liggitt
aa9e2e1d28 client-go dynamic context
Kubernetes-commit: 6fa54d715fbc992afb483e71d450d5dbd66990eb
2020-03-06 01:27:11 -05:00
Jordan Liggitt
62641f51d9 client-go dynamic client: update DeleteOptions callers
Kubernetes-commit: b19dc3a474e840340cb357f5ea9f4e575bad888d
2020-03-06 10:20:40 -05:00
Jordan Liggitt
6d9df0db96 client-go dynamic client: pass DeleteOptions by value
Kubernetes-commit: 161b7513f73185745f8c17db5a56b7229157f876
2020-03-06 10:20:27 -05:00
Antoine Pelisse
fe51308355 Bump sigs.k8s.io/structured-merge-diff to v3
Kubernetes-commit: df41fd932bef1686b30a1abee477c5009ebabe80
2020-03-05 13:09:50 -08:00
Christian Huffman
722d7c83fd Moved CSIDriver to GA
Kubernetes-commit: 726af6bd7f2f3d7e0b6b37b476672944f601af41
2020-02-28 15:22:45 -05:00
Kubernetes Publisher
5c2a76ef0f Merge pull request #88708 from mikedanese/deleteopts
Migrate clientset metav1.DeleteOpts to pass-by-value

Kubernetes-commit: 5708511499fe500ae3b4bbd40204cef382f652e8
2020-03-06 20:33:42 +00:00
Kubernetes Publisher
b4b41575df Merge pull request #88465 from alvaroaleman/utilerrors-implement-errors-is
Utilerrors.Aggregate: Allow using with errors.Is()

Kubernetes-commit: c812375ed605dafa3a7802fc9e21165031de9034
2020-03-06 20:33:40 +00:00
Kubernetes Publisher
2f9d817fc1 Merge pull request #87553 from MikeSpreitzer/shared-informer-comments-redux
More refinement of comments and parameter names for informers

Kubernetes-commit: 50c0a698d83f3eb1325b80270471eaf06c4870d2
2020-03-06 20:33:39 +00:00
Kubernetes Publisher
9793c43f36 Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: f44ed022527037752b74d6e299c7666c18a9463a
2020-03-06 00:33:55 +00:00
Monis Khan
a884d2d0bc Use the same default namespace across event recorders
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 167d6a2c8b00413cb52841ee49dd042bfb7d10c9
2020-03-04 13:49:33 -05:00
Kubernetes Publisher
c2cd954c1a Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: ee5e5d216da4d3ec8106e3cfc1507599b8787b7b
2020-03-04 18:02:38 +00:00
Kubernetes Publisher
c97745df16 Merge pull request #86173 from soltysh/cli_defaults
stop defaulting kubeconfig to http://localhost:8080

Kubernetes-commit: b5b675491b69b5d48bf112a896bc739e500c7275
2020-03-04 20:30:36 +00:00
Kubernetes Publisher
cbb845eb7b Merge pull request #88769 from deads2k/SNI
Support TLS Server Name overrides in kubeconfig file

Kubernetes-commit: bd6640a8e003059ee98f84e7378d97f8337c5e0b
2020-03-04 20:30:35 +00:00
Kubernetes Publisher
130ee555e2 Merge pull request #88783 from neolit123/1.18-fix-kubectl-auth-verbosity
client-go: use klog.V(3) for the cert-rotation controller start/stop

Kubernetes-commit: cadd51783bd463b3fdd6c1416e596493a717fe83
2020-03-04 20:30:34 +00:00
Lubomir I. Ivanov
db9ba44b57 client-go: use klog.V(3) for the cert-rotation controller start/stop
Introduce a verbosity level for the start and stop notifications,
so that regular calls to commands such as:
  "kubectl auth ..."
would only contain the "yes" / "no" output.

Kubernetes-commit: b2677b1e572ae1cd8b823683e88005b7857d8938
2020-03-04 01:35:17 +02:00
David Eads
275032820d update override behavior for kubectl --tls-server-name
Kubernetes-commit: 9dcbc0bf909a794cf77a801bfd29e306791b1e24
2020-03-03 13:16:50 -05:00
Maciej Szulik
39958e487b Provide more verbose empty config error based on the context
Kubernetes-commit: 07dc17ffd9aadd9918511334e13b02dc817828a5
2020-03-03 18:42:19 +01:00
Mike Danese
9c3e96b764 automated refactor
Kubernetes-commit: c58e69ec791e4dd8a1298d5c2cc0649cf9176f67
2020-03-01 09:24:42 -08:00
Mike Danese
cca4bbf022 update clients
Kubernetes-commit: 86bd06c8820a785cb8d74ef29d4a6a80c08988c0
2020-03-01 08:54:33 -08:00
saad-ali
38ae657aae Update dep k8s.io/utils to 0a110f9eb7ab
Kubernetes-commit: 22e8189f40fc95b18bad2b59ba2ad20ae7c69ea9
2020-02-28 18:22:45 -08:00
Kubernetes Publisher
665c6734d2 Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: ea1576a65d9e2d953b188ede356fecfeba513233
2020-03-03 17:49:44 +00:00
James Munnelly
60fa75c071 Extend client-go csr package to invalidate CSRs based on signerName
Kubernetes-commit: c2367bd5da68112ad3031dd33933859dacf8db58
2020-03-03 13:14:04 +00:00
Kubernetes Publisher
b229bee3a8 Merge pull request #88744 from jackkleeman/kubelet-handle-intermed
Support intermediate certificate in certificate store

Kubernetes-commit: 79e1ad2f4bbd05b1e56b7b57b63b2c1d67b90156
2020-03-03 20:30:27 +00:00
Kubernetes Publisher
5e884de6b7 Merge pull request #79083 from jackkleeman/client-cert-file-reload
Add ability to reload client certificates from disk

Kubernetes-commit: 4b1ee392c180233c085ba0a17949bc9197535c11
2020-03-03 20:30:26 +00:00
Kubernetes Publisher
b4195b390d Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: 28ec82ddbdfc09619ce00a2aae498cb3c9d3ebc8
2020-03-02 20:30:27 +00:00
Jack Kleeman
68503dd6f8 Support intermediate certificate in certificate store
Kubernetes-commit: 83a223f5ee3790b7ed54197986d4317e75da1652
2020-03-02 19:48:38 +00:00
Julian V. Modesto
5403cae7f7 Add context and options to scale client
Kubernetes-commit: da3c3432d8361f315e7f562563e68316b10b9a2d
2020-02-26 18:39:57 -05:00
Rob Scott
4c92726be3 Adding IngressClass to networking/v1beta1
Co-authored-by: Christopher M. Luciano <cmluciano@us.ibm.com>

Kubernetes-commit: 132d2afca0794b4bcaedb6dbbefe4e9d66e80239
2020-02-24 21:20:45 -08:00
Kubernetes Publisher
bc450043dc Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: e3c76196e4cf21633b8b0333ef5bf0a780b922cd
2020-02-29 16:26:12 +00:00
Kubernetes Publisher
cad9369f5c Merge pull request #88246 from munnerz/csr-signername-controllers
Update CSR controllers & kubelet to respect signerName field

Kubernetes-commit: 03b7f272c8287fdaafa67b82f1c577a96c5a238a
2020-02-29 20:25:50 +00:00
Kubernetes Publisher
8f319dd0ec Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: d883d5cd787a84ae6e95276196c2d57024f1dba1
2020-02-27 20:41:23 +00:00
Alvaro Aleman
63b7bdc3fa Utilerrors.Aggregate: Allow using with errors.Is()
Kubernetes-commit: 212190e25e18600bbca2eb5c77aa3fe5bcc55af1
2020-02-24 15:15:04 +01:00
James Munnelly
6ca9f7245f certificates: update controllers to understand signerName field
Signed-off-by: James Munnelly <james.munnelly@jetstack.io>

Kubernetes-commit: d5dae048983cd299cdce9d2703f564bf4bd246ee
2020-02-17 23:06:02 +00:00
jennybuckley
69a103b2ce Improve rate limiter latency logging and metrics
Kubernetes-commit: 2bcf99f05fdc47fb4bc3601b9134408483f59773
2020-02-13 13:32:12 -08:00
Kubernetes Publisher
010dce13f8 Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: 60790dbb519fd09a619fd3d5823804a5b1a513bf
2020-02-23 09:29:41 +00:00
Kubernetes Publisher
8f6e628cf6 Merge pull request #88382 from jpbetz/parallel-mem-client-resource-discovery
Refresh discovery server resources for memCacheClient in parallel

Kubernetes-commit: 62b0bbc1c64f7ca5d3b2a9503158975166af9078
2020-02-23 12:30:06 +00:00
Kubernetes Publisher
39a9bc1d5a Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: 490f4bacd293561bd0b5b785f30c666d99ecaeec
2020-02-21 13:41:40 +00:00
Kubernetes Publisher
b52b5a278b Merge pull request #88100 from jiahuif/kubelet-bootstrap-csr-logging
add logging for kubelet csr being approved and issued.

Kubernetes-commit: bf050f9794973694e2cc9c8df2f5e8b354af63f6
2020-02-23 12:30:03 +00:00
Joe Betz
8f2c761d18 Refresh discovery server resources for memCacheClient in parallel
Kubernetes-commit: 190a72392ae712fbbee979e95a6017ccb578877d
2020-02-20 13:40:23 -08:00
Benjamin Elder
46ad60adf9 update golang.org/x/crypto
Kubernetes-commit: 86ead631585825725e39f9a5e99c169b892a338c
2020-02-20 13:17:51 -08:00
Kubernetes Publisher
40d13067fe Merge remote-tracking branch 'origin/master' into release-1.18
Kubernetes-commit: 5c1937c55024a7ddf5389651a6a4a02a95d9c1f5
2020-02-19 16:29:48 +00:00
Kubernetes Publisher
789de056aa Merge pull request #88267 from mfojtik/revert-con-refused-retry
client-go: remove connection refused to list of retriable errors

Kubernetes-commit: f38ca13bc8c6e1d99be33afa2b9d3a3f6fb56ba3
2020-02-23 12:30:01 +00:00
Michal Fojtik
6c3faaec46 rest: remove connection refused from the list of retriable errors
Kubernetes-commit: 0dfe0c793b5b85bd85cec7b77679ba78c1617357
2020-02-18 14:44:04 +01:00
Jiahui Feng
b8a07f42d5 add logging for csr being approved and issued.
Kubernetes-commit: fdd7424d191b43bc9b1c4364ddf9c88547883072
2020-02-12 11:09:56 -08:00
Mike Spreitzer
1245dcc076 More refinement of comments and parameter names for informers
Removed the incorrect promise of coherency in the answer to a query to
an informer's local cache.  Removed the definition of "collection
state", because it was only used in the now-removed promise.  Added a
remark about ordering of states that appear in an informer's local
cache.

Brushed up the commentary on resync period.  Changed the relevant
parameter of NewSharedInformer to have the same name as the
corresponding parameter to NewSharedIndexInformer.

Kubernetes-commit: b8e2ad5926c3a6872422ad25cf9867e10e052a7d
2020-01-26 02:43:33 -05:00
Suresh Kumar Ponnusamy
292400c132 Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
Jack Kleeman
f4cd5ff32d Add ReloadCertFromDisk flag to rest.Config and to kubeconfig which allows the provided client certificate files to be reloaded from disk (currently on every use)
Close outbound connections when using a cert callback and certificates rotate. This means that we won't get into a situation where we have open TLS connections using expires certs, which would get unauthorized errors at the apiserver

Attempt to retrieve a new certificate if open connections near expiry, to prevent the case where the cert expires but we haven't yet opened a new TLS connection and so GetClientCertificate hasn't been called.

Move certificate rotation logic to a separate function

Rely on generic transport approach to handle closing TLS client connections in exec plugin; no need to use a custom dialer as this is now the default behaviour of the transport when faced with a cert callback. As a result of handling this case, it is now safe to apply the transport approach even in cases where there is a custom Dialer (this will not affect kubelet connrotation behaviour, because that uses a custom transport, not just a dialer).

Check expiry of the full TLS certificate chain that will be presented, not only the leaf. Only do this check when the certificate actually rotates. Start the certificate as a zero value, not nil, so that we don't see a rotation when there is in fact no client certificate

Drain the timer when we first initialize it, to prevent immediate rotation. Additionally, calling Stop() on the timer isn't necessary.

Don't close connections on the first 'rotation'

Remove RotateCertFromDisk and RotateClientCertFromDisk flags.

Instead simply default to rotating certificates from disk whenever files are exclusively provided.

Add integration test for client certificate rotation

Simplify logic; rotate every 5 mins

Instead of trying to be clever and checking for rotation just before an
expiry, let's match the logic of the new apiserver cert rotation logic
as much as possible. We write a controller that checks for rotation
every 5 mins. We also check on every new connection.

Respond to review

Fix kubelet certificate rotation logic

The kubelet rotation logic seems to be broken because it expects its
cert files to end up as cert data whereas in fact they end up as a
callback. We should just call the tlsConfig GetCertificate callback
as this obtains a current cert even in cases where a static cert is
provided, and check that for validity.

Later on we can refactor all of the kubelet logic so that all it does is
write files to disk, and the cert rotation work does the rest.

Only read certificates once a second at most

Respond to review

1) Don't blat the cert file names
2) Make it more obvious where we have a neverstop
3) Naming
4) Verbosity

Avoid cache busting

Use filenames as cache keys when rotation is enabled, and add the
rotation later in the creation of the transport.

Caller should start the rotating dialer

Add continuous request rotation test

Rebase: use context in List/Watch

Swap goroutine around

Retry GETs on net.IsProbableEOF

Refactor certRotatingDialer

For simplicity, don't affect cert callbacks

To reduce change surface, lets not try to handle the case of a changing
GetCert callback in this PR. Reverting this commit should be sufficient
to handle that case in a later PR.

This PR will focus only on rotating certificate and key files.
Therefore, we don't need to modify the exec auth plugin.

Fix copyright year

Kubernetes-commit: 929b1559a0b855d996257ab3ad5364605edc253d
2019-06-14 22:08:58 +01:00
David Eads
e302dbfef5 stop defaulting kubeconfig to http://localhost:8080
Kubernetes-commit: b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee
2018-04-12 09:42:25 -04:00
253 changed files with 3314 additions and 1281 deletions

18
Godeps/Godeps.json generated
View File

@@ -76,7 +76,7 @@
},
{
"ImportPath": "github.com/evanphx/json-patch",
"Rev": "v4.2.0"
"Rev": "v4.9.0"
},
{
"ImportPath": "github.com/fsnotify/fsnotify",
@@ -238,6 +238,10 @@
"ImportPath": "github.com/peterbourgon/diskv",
"Rev": "v2.0.1"
},
{
"ImportPath": "github.com/pkg/errors",
"Rev": "v0.8.1"
},
{
"ImportPath": "github.com/pmezard/go-difflib",
"Rev": "v1.0.0"
@@ -264,7 +268,7 @@
},
{
"ImportPath": "golang.org/x/crypto",
"Rev": "60c769a6c586"
"Rev": "bac4c82f6975"
},
{
"ImportPath": "golang.org/x/exp",
@@ -348,11 +352,11 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "026463abc787"
"Rev": "v0.18.9"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "2373d029717c"
"Rev": "v0.18.9"
},
{
"ImportPath": "k8s.io/gengo",
@@ -364,15 +368,15 @@
},
{
"ImportPath": "k8s.io/kube-openapi",
"Rev": "bf4fb3bd569c"
"Rev": "61e04a5be9a6"
},
{
"ImportPath": "k8s.io/utils",
"Rev": "5f6fbceb4c31"
"Rev": "a9aa75ae1b89"
},
{
"ImportPath": "sigs.k8s.io/structured-merge-diff/v3",
"Rev": "5e70324e7c1c"
"Rev": "v3.0.0"
},
{
"ImportPath": "sigs.k8s.io/yaml",

View File

@@ -190,16 +190,29 @@ func (d *memCacheClient) refreshLocked() error {
return err
}
wg := &sync.WaitGroup{}
resultLock := &sync.Mutex{}
rl := map[string]*cacheEntry{}
for _, g := range gl.Groups {
for _, v := range g.Versions {
r, err := d.serverResourcesForGroupVersion(v.GroupVersion)
rl[v.GroupVersion] = &cacheEntry{r, err}
if err != nil {
utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", v.GroupVersion, err))
}
gv := v.GroupVersion
wg.Add(1)
go func() {
defer wg.Done()
defer utilruntime.HandleCrash()
r, err := d.serverResourcesForGroupVersion(gv)
if err != nil {
utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", gv, err))
}
resultLock.Lock()
defer resultLock.Unlock()
rl[gv] = &cacheEntry{r, err}
}()
}
}
wg.Wait()
d.groupToServerResources, d.groupList = rl, gl
d.cacheValid = true

View File

@@ -205,16 +205,22 @@ func TestServerGroupsFails(t *testing.T) {
func TestPartialPermanentFailure(t *testing.T) {
fake := &fakeDiscovery{
groupList: &metav1.APIGroupList{
Groups: []metav1.APIGroup{{
Name: "astronomy",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy/v8beta1",
Version: "v8beta1",
}, {
GroupVersion: "astronomy2/v8beta1",
Version: "v8beta1",
}},
}},
Groups: []metav1.APIGroup{
{
Name: "astronomy",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy/v8beta1",
Version: "v8beta1",
}},
},
{
Name: "astronomy2",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy2/v8beta1",
Version: "v8beta1",
}},
},
},
},
resourceMap: map[string]*resourceMapEntry{
"astronomy/v8beta1": {
@@ -286,16 +292,22 @@ func TestPartialPermanentFailure(t *testing.T) {
func TestPartialRetryableFailure(t *testing.T) {
fake := &fakeDiscovery{
groupList: &metav1.APIGroupList{
Groups: []metav1.APIGroup{{
Name: "astronomy",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy/v8beta1",
Version: "v8beta1",
}, {
GroupVersion: "astronomy2/v8beta1",
Version: "v8beta1",
}},
}},
Groups: []metav1.APIGroup{
{
Name: "astronomy",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy/v8beta1",
Version: "v8beta1",
}},
},
{
Name: "astronomy2",
Versions: []metav1.GroupVersionForDiscovery{{
GroupVersion: "astronomy2/v8beta1",
Version: "v8beta1",
}},
},
},
},
resourceMap: map[string]*resourceMapEntry{
"astronomy/v8beta1": {

View File

@@ -18,6 +18,7 @@ package dynamic
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/http"
@@ -134,7 +135,7 @@ func TestList(t *testing.T) {
}
defer srv.Close()
got, err := cl.Resource(resource).Namespace(tc.namespace).List(metav1.ListOptions{})
got, err := cl.Resource(resource).Namespace(tc.namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
t.Errorf("unexpected error when listing %q: %v", tc.name, err)
continue
@@ -209,7 +210,7 @@ func TestGet(t *testing.T) {
}
defer srv.Close()
got, err := cl.Resource(resource).Namespace(tc.namespace).Get(tc.name, metav1.GetOptions{}, tc.subresource...)
got, err := cl.Resource(resource).Namespace(tc.namespace).Get(context.TODO(), tc.name, metav1.GetOptions{}, tc.subresource...)
if err != nil {
t.Errorf("unexpected error when getting %q: %v", tc.name, err)
continue
@@ -234,7 +235,7 @@ func TestDelete(t *testing.T) {
namespace string
name string
path string
deleteOptions *metav1.DeleteOptions
deleteOptions metav1.DeleteOptions
}{
{
name: "normal_delete",
@@ -260,7 +261,7 @@ func TestDelete(t *testing.T) {
namespace: "nstest",
name: "namespaced_delete_with_options",
path: "/apis/gtest/vtest/namespaces/nstest/rtest/namespaced_delete_with_options",
deleteOptions: &metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}, PropagationPolicy: &background},
deleteOptions: metav1.DeleteOptions{Preconditions: &metav1.Preconditions{UID: &uid}, PropagationPolicy: &background},
},
}
for _, tc := range tcs {
@@ -283,7 +284,7 @@ func TestDelete(t *testing.T) {
}
defer srv.Close()
err = cl.Resource(resource).Namespace(tc.namespace).Delete(tc.name, tc.deleteOptions, tc.subresource...)
err = cl.Resource(resource).Namespace(tc.namespace).Delete(context.TODO(), tc.name, tc.deleteOptions, tc.subresource...)
if err != nil {
t.Errorf("unexpected error when deleting %q: %v", tc.name, err)
continue
@@ -331,7 +332,7 @@ func TestDeleteCollection(t *testing.T) {
}
defer srv.Close()
err = cl.Resource(resource).Namespace(tc.namespace).DeleteCollection(nil, metav1.ListOptions{})
err = cl.Resource(resource).Namespace(tc.namespace).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{})
if err != nil {
t.Errorf("unexpected error when deleting collection %q: %v", tc.name, err)
continue
@@ -404,7 +405,7 @@ func TestCreate(t *testing.T) {
}
defer srv.Close()
got, err := cl.Resource(resource).Namespace(tc.namespace).Create(tc.obj, metav1.CreateOptions{}, tc.subresource...)
got, err := cl.Resource(resource).Namespace(tc.namespace).Create(context.TODO(), tc.obj, metav1.CreateOptions{}, tc.subresource...)
if err != nil {
t.Errorf("unexpected error when creating %q: %v", tc.name, err)
continue
@@ -481,7 +482,7 @@ func TestUpdate(t *testing.T) {
}
defer srv.Close()
got, err := cl.Resource(resource).Namespace(tc.namespace).Update(tc.obj, metav1.UpdateOptions{}, tc.subresource...)
got, err := cl.Resource(resource).Namespace(tc.namespace).Update(context.TODO(), tc.obj, metav1.UpdateOptions{}, tc.subresource...)
if err != nil {
t.Errorf("unexpected error when updating %q: %v", tc.name, err)
continue
@@ -550,7 +551,7 @@ func TestWatch(t *testing.T) {
}
defer srv.Close()
watcher, err := cl.Resource(resource).Namespace(tc.namespace).Watch(metav1.ListOptions{})
watcher, err := cl.Resource(resource).Namespace(tc.namespace).Watch(context.TODO(), metav1.ListOptions{})
if err != nil {
t.Errorf("unexpected error when watching %q: %v", tc.name, err)
continue
@@ -640,7 +641,7 @@ func TestPatch(t *testing.T) {
}
defer srv.Close()
got, err := cl.Resource(resource).Namespace(tc.namespace).Patch(tc.name, types.StrategicMergePatchType, tc.patch, metav1.PatchOptions{}, tc.subresource...)
got, err := cl.Resource(resource).Namespace(tc.namespace).Patch(context.TODO(), tc.name, types.StrategicMergePatchType, tc.patch, metav1.PatchOptions{}, tc.subresource...)
if err != nil {
t.Errorf("unexpected error when patching %q: %v", tc.name, err)
continue

View File

@@ -17,6 +17,7 @@ limitations under the License.
package dynamicinformer
import (
"context"
"sync"
"time"
@@ -125,13 +126,13 @@ func NewFilteredDynamicInformer(client dynamic.Interface, gvr schema.GroupVersio
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Resource(gvr).Namespace(namespace).List(options)
return client.Resource(gvr).Namespace(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.Resource(gvr).Namespace(namespace).Watch(options)
return client.Resource(gvr).Namespace(namespace).Watch(context.TODO(), options)
},
},
&unstructured.Unstructured{},

View File

@@ -48,7 +48,7 @@ func TestDynamicSharedInformerFactory(t *testing.T) {
gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"},
trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, _ *unstructured.Unstructured) *unstructured.Unstructured {
testObject := newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo")
createdObj, err := fakeClient.Resource(gvr).Namespace(ns).Create(testObject, metav1.CreateOptions{})
createdObj, err := fakeClient.Resource(gvr).Namespace(ns).Create(context.TODO(), testObject, metav1.CreateOptions{})
if err != nil {
t.Error(err)
}
@@ -71,7 +71,7 @@ func TestDynamicSharedInformerFactory(t *testing.T) {
existingObj: newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"),
trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured {
testObject.Object["spec"] = "updatedName"
updatedObj, err := fakeClient.Resource(gvr).Namespace(ns).Update(testObject, metav1.UpdateOptions{})
updatedObj, err := fakeClient.Resource(gvr).Namespace(ns).Update(context.TODO(), testObject, metav1.UpdateOptions{})
if err != nil {
t.Error(err)
}
@@ -93,7 +93,7 @@ func TestDynamicSharedInformerFactory(t *testing.T) {
gvr: schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "deployments"},
existingObj: newUnstructured("extensions/v1beta1", "Deployment", "ns-foo", "name-foo"),
trigger: func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured {
err := fakeClient.Resource(gvr).Namespace(ns).Delete(testObject.GetName(), &metav1.DeleteOptions{})
err := fakeClient.Resource(gvr).Namespace(ns).Delete(context.TODO(), testObject.GetName(), metav1.DeleteOptions{})
if err != nil {
t.Error(err)
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package fake
import (
"context"
"strings"
"k8s.io/apimachinery/pkg/api/meta"
@@ -86,7 +87,7 @@ func (c *dynamicResourceClient) Namespace(ns string) dynamic.ResourceInterface {
return &ret
}
func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) {
var uncastRet runtime.Object
var err error
switch {
@@ -132,7 +133,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta
return ret, err
}
func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) {
var uncastRet runtime.Object
var err error
switch {
@@ -168,7 +169,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta
return ret, err
}
func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) {
var uncastRet runtime.Object
var err error
switch {
@@ -196,7 +197,7 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt
return ret, err
}
func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error {
func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error {
var err error
switch {
case len(c.namespace) == 0 && len(subresources) == 0:
@@ -219,7 +220,7 @@ func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions,
return err
}
func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var err error
switch {
case len(c.namespace) == 0:
@@ -235,7 +236,7 @@ func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, lis
return err
}
func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) {
var uncastRet runtime.Object
var err error
switch {
@@ -270,7 +271,7 @@ func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subreso
return ret, err
}
func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
var obj runtime.Object
var err error
switch {
@@ -317,7 +318,7 @@ func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.Uns
return list, nil
}
func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
switch {
case len(c.namespace) == 0:
return c.client.Fake.
@@ -333,7 +334,7 @@ func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface,
}
// TODO: opts are currently ignored.
func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) {
var uncastRet runtime.Object
var err error
switch {

View File

@@ -17,6 +17,7 @@ limitations under the License.
package fake
import (
"context"
"fmt"
"testing"
@@ -68,7 +69,7 @@ func TestList(t *testing.T) {
newUnstructured("group/version", "TheKind", "ns-foo", "name-baz"),
newUnstructured("group2/version", "TheKind", "ns-foo", "name2-baz"),
)
listFirst, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).List(metav1.ListOptions{})
listFirst, err := client.Resource(schema.GroupVersionResource{Group: "group", Version: "version", Resource: "thekinds"}).List(context.TODO(), metav1.ListOptions{})
if err != nil {
t.Fatal(err)
}
@@ -96,7 +97,7 @@ func (tc *patchTestCase) runner(t *testing.T) {
client := NewSimpleDynamicClient(runtime.NewScheme(), tc.object)
resourceInterface := client.Resource(schema.GroupVersionResource{Group: testGroup, Version: testVersion, Resource: testResource}).Namespace(testNamespace)
got, recErr := resourceInterface.Patch(testName, tc.patchType, tc.patchBytes, metav1.PatchOptions{})
got, recErr := resourceInterface.Patch(context.TODO(), testName, tc.patchType, tc.patchBytes, metav1.PatchOptions{})
if err := tc.verifyErr(recErr); err != nil {
t.Error(err)

View File

@@ -17,6 +17,8 @@ limitations under the License.
package dynamic
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -29,15 +31,15 @@ type Interface interface {
}
type ResourceInterface interface {
Create(obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)
Update(obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error)
UpdateStatus(obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error)
Delete(name string, options *metav1.DeleteOptions, subresources ...string) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)
List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error)
Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error)
Update(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error)
UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error)
Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error
DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error)
List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error)
}
type NamespaceableResourceInterface interface {

View File

@@ -90,7 +90,7 @@ func (c *dynamicResourceClient) Namespace(ns string) ResourceInterface {
return &ret
}
func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) {
outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
if err != nil {
return nil, err
@@ -112,7 +112,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(context.TODO())
Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}
@@ -128,7 +128,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta
return uncastObj.(*unstructured.Unstructured), nil
}
func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) {
accessor, err := meta.Accessor(obj)
if err != nil {
return nil, err
@@ -147,7 +147,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(context.TODO())
Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}
@@ -163,7 +163,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta
return uncastObj.(*unstructured.Unstructured), nil
}
func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) {
accessor, err := meta.Accessor(obj)
if err != nil {
return nil, err
@@ -183,7 +183,7 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt
AbsPath(append(c.makeURLSegments(name), "status")...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(context.TODO())
Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}
@@ -199,14 +199,11 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt
return uncastObj.(*unstructured.Unstructured), nil
}
func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error {
func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error {
if len(name) == 0 {
return fmt.Errorf("name is required")
}
if opts == nil {
opts = &metav1.DeleteOptions{}
}
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), opts)
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts)
if err != nil {
return err
}
@@ -215,15 +212,12 @@ func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions,
Delete().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(deleteOptionsByte).
Do(context.TODO())
Do(ctx)
return result.Error()
}
func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
if opts == nil {
opts = &metav1.DeleteOptions{}
}
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), opts)
func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error {
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts)
if err != nil {
return err
}
@@ -233,15 +227,15 @@ func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, lis
AbsPath(c.makeURLSegments("")...).
Body(deleteOptionsByte).
SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1).
Do(context.TODO())
Do(ctx)
return result.Error()
}
func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) {
if len(name) == 0 {
return nil, fmt.Errorf("name is required")
}
result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(context.TODO())
result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}
@@ -256,8 +250,8 @@ func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subreso
return uncastObj.(*unstructured.Unstructured), nil
}
func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(context.TODO())
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}
@@ -280,14 +274,14 @@ func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.Uns
return list, nil
}
func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.client.Get().AbsPath(c.makeURLSegments("")...).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Watch(context.TODO())
Watch(ctx)
}
func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) {
func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) {
if len(name) == 0 {
return nil, fmt.Errorf("name is required")
}
@@ -296,7 +290,7 @@ func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []by
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(data).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(context.TODO())
Do(ctx)
if err := result.Error(); err != nil {
return nil, err
}

View File

@@ -156,7 +156,7 @@ func main() {
prompt()
fmt.Println("Deleting deployment...")
deletePolicy := metav1.DeletePropagationForeground
if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", &metav1.DeleteOptions{
if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", metav1.DeleteOptions{
PropagationPolicy: &deletePolicy,
}); err != nil {
panic(err)

View File

@@ -19,6 +19,7 @@ package main
import (
"bufio"
"context"
"flag"
"fmt"
"os"
@@ -108,7 +109,7 @@ func main() {
// Create Deployment
fmt.Println("Creating deployment...")
result, err := client.Resource(deploymentRes).Namespace(namespace).Create(deployment, metav1.CreateOptions{})
result, err := client.Resource(deploymentRes).Namespace(namespace).Create(context.TODO(), deployment, metav1.CreateOptions{})
if err != nil {
panic(err)
}
@@ -133,7 +134,7 @@ func main() {
retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error {
// Retrieve the latest version of Deployment before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
result, getErr := client.Resource(deploymentRes).Namespace(namespace).Get("demo-deployment", metav1.GetOptions{})
result, getErr := client.Resource(deploymentRes).Namespace(namespace).Get(context.TODO(), "demo-deployment", metav1.GetOptions{})
if getErr != nil {
panic(fmt.Errorf("failed to get latest version of Deployment: %v", getErr))
}
@@ -157,7 +158,7 @@ func main() {
panic(err)
}
_, updateErr := client.Resource(deploymentRes).Namespace(namespace).Update(result, metav1.UpdateOptions{})
_, updateErr := client.Resource(deploymentRes).Namespace(namespace).Update(context.TODO(), result, metav1.UpdateOptions{})
return updateErr
})
if retryErr != nil {
@@ -168,7 +169,7 @@ func main() {
// List Deployments
prompt()
fmt.Printf("Listing deployments in namespace %q:\n", apiv1.NamespaceDefault)
list, err := client.Resource(deploymentRes).Namespace(namespace).List(metav1.ListOptions{})
list, err := client.Resource(deploymentRes).Namespace(namespace).List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
@@ -185,10 +186,10 @@ func main() {
prompt()
fmt.Println("Deleting deployment...")
deletePolicy := metav1.DeletePropagationForeground
deleteOptions := &metav1.DeleteOptions{
deleteOptions := metav1.DeleteOptions{
PropagationPolicy: &deletePolicy,
}
if err := client.Resource(deploymentRes).Namespace(namespace).Delete("demo-deployment", deleteOptions); err != nil {
if err := client.Resource(deploymentRes).Namespace(namespace).Delete(context.TODO(), "demo-deployment", deleteOptions); err != nil {
panic(err)
}

14
go.mod
View File

@@ -9,7 +9,7 @@ require (
github.com/Azure/go-autorest/autorest v0.9.0
github.com/Azure/go-autorest/autorest/adal v0.5.0
github.com/davecgh/go-spew v1.1.1
github.com/evanphx/json-patch v4.2.0+incompatible
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/gogo/protobuf v1.3.1
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903
github.com/golang/protobuf v1.3.2
@@ -23,21 +23,21 @@ require (
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/appengine v1.5.0 // indirect
k8s.io/api v0.0.0-20200214081624-026463abc787
k8s.io/apimachinery v0.0.0-20200214081019-2373d029717c
k8s.io/api v0.18.9
k8s.io/apimachinery v0.18.9
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20200117235808-5f6fbceb4c31
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89
sigs.k8s.io/yaml v1.2.0
)
replace (
golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
k8s.io/api => k8s.io/api v0.0.0-20200214081624-026463abc787
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20200214081019-2373d029717c
k8s.io/api => k8s.io/api v0.18.9
k8s.io/apimachinery => k8s.io/apimachinery v0.18.9
)

26
go.sum
View File

@@ -30,8 +30,8 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs=
github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I=
github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -108,6 +108,8 @@ github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
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.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.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/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
@@ -121,8 +123,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo=
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -182,20 +184,20 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20200214081624-026463abc787/go.mod h1:brPp6rLV9ZWi2IgXmvCsY7TKw2l27eF4rfCHlyW88ys=
k8s.io/apimachinery v0.0.0-20200214081019-2373d029717c/go.mod h1:5X8oEhnd931nEg6/Nkumo00nT6ZsCLp2h7Xwd7Ym6P4=
k8s.io/api v0.18.9/go.mod h1:9u/h6sUh6FxfErv7QqetX1EB3yBMIYOBXzdcf0Gf0rc=
k8s.io/apimachinery v0.18.9/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c h1:/KUFqjjqAcY4Us6luF5RDNZ16KJtb49HfR3ZHB9qYXM=
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
k8s.io/utils v0.0.0-20200117235808-5f6fbceb4c31 h1:KCcLuc/HD1RogJgEbZi9ObRuLv1bgiRCfAbidLKrUpg=
k8s.io/utils v0.0.0-20200117235808-5f6fbceb4c31/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY=
k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU=
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200207200219-5e70324e7c1c h1:xQP7F7Lntt2dtYmg12WPQHObOrAyPHlMWP1JVSa79GM=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200207200219-5e70324e7c1c/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E=
sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=

View File

@@ -244,6 +244,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=networking.k8s.io, Version=v1beta1
case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Ingresses().Informer()}, nil
case networkingv1beta1.SchemeGroupVersion.WithResource("ingressclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IngressClasses().Informer()}, nil
// Group=node.k8s.io, Version=v1alpha1
case nodev1alpha1.SchemeGroupVersion.WithResource("runtimeclasses"):
@@ -306,6 +308,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil
// Group=storage.k8s.io, Version=v1
case storagev1.SchemeGroupVersion.WithResource("csidrivers"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSIDrivers().Informer()}, nil
case storagev1.SchemeGroupVersion.WithResource("csinodes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSINodes().Informer()}, nil
case storagev1.SchemeGroupVersion.WithResource("storageclasses"):

View File

@@ -0,0 +1,89 @@
/*
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 informer-gen. DO NOT EDIT.
package v1beta1
import (
"context"
time "time"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1beta1 "k8s.io/client-go/listers/networking/v1beta1"
cache "k8s.io/client-go/tools/cache"
)
// IngressClassInformer provides access to a shared informer and lister for
// IngressClasses.
type IngressClassInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta1.IngressClassLister
}
type ingressClassInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewIngressClassInformer constructs a new informer for IngressClass type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredIngressClassInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredIngressClassInformer constructs a new informer for IngressClass type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1beta1().IngressClasses().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1beta1().IngressClasses().Watch(context.TODO(), options)
},
},
&networkingv1beta1.IngressClass{},
resyncPeriod,
indexers,
)
}
func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredIngressClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *ingressClassInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&networkingv1beta1.IngressClass{}, f.defaultInformer)
}
func (f *ingressClassInformer) Lister() v1beta1.IngressClassLister {
return v1beta1.NewIngressClassLister(f.Informer().GetIndexer())
}

View File

@@ -26,6 +26,8 @@ import (
type Interface interface {
// Ingresses returns a IngressInformer.
Ingresses() IngressInformer
// IngressClasses returns a IngressClassInformer.
IngressClasses() IngressClassInformer
}
type version struct {
@@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
func (v *version) Ingresses() IngressInformer {
return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// IngressClasses returns a IngressClassInformer.
func (v *version) IngressClasses() IngressClassInformer {
return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

View File

@@ -0,0 +1,89 @@
/*
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 informer-gen. DO NOT EDIT.
package v1
import (
"context"
time "time"
storagev1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1 "k8s.io/client-go/listers/storage/v1"
cache "k8s.io/client-go/tools/cache"
)
// CSIDriverInformer provides access to a shared informer and lister for
// CSIDrivers.
type CSIDriverInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.CSIDriverLister
}
type cSIDriverInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}
// NewCSIDriverInformer constructs a new informer for CSIDriver type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredCSIDriverInformer(client, resyncPeriod, indexers, nil)
}
// NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.StorageV1().CSIDrivers().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.StorageV1().CSIDrivers().Watch(context.TODO(), options)
},
},
&storagev1.CSIDriver{},
resyncPeriod,
indexers,
)
}
func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredCSIDriverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&storagev1.CSIDriver{}, f.defaultInformer)
}
func (f *cSIDriverInformer) Lister() v1.CSIDriverLister {
return v1.NewCSIDriverLister(f.Informer().GetIndexer())
}

View File

@@ -24,6 +24,8 @@ import (
// Interface provides access to all the informers in this group version.
type Interface interface {
// CSIDrivers returns a CSIDriverInformer.
CSIDrivers() CSIDriverInformer
// CSINodes returns a CSINodeInformer.
CSINodes() CSINodeInformer
// StorageClasses returns a StorageClassInformer.
@@ -43,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// CSIDrivers returns a CSIDriverInformer.
func (v *version) CSIDrivers() CSIDriverInformer {
return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// CSINodes returns a CSINodeInformer.
func (v *version) CSINodes() CSINodeInformer {
return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}

View File

@@ -97,15 +97,15 @@ func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutating
}
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &admissionregistrationv1.MutatingWebhookConfiguration{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions)
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts)
_, err := c.Fake.Invokes(action, &admissionregistrationv1.MutatingWebhookConfigurationList{})
return err

View File

@@ -97,15 +97,15 @@ func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, valida
}
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &admissionregistrationv1.ValidatingWebhookConfiguration{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions)
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts)
_, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingWebhookConfigurationList{})
return err

View File

@@ -40,8 +40,8 @@ type MutatingWebhookConfigurationsGetter interface {
type MutatingWebhookConfigurationInterface interface {
Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.MutatingWebhookConfiguration, error)
Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebh
}
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("mutatingwebhookconfigurations").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("mutatingwebhookconfigurations").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ValidatingWebhookConfigurationsGetter interface {
type ValidatingWebhookConfigurationInterface interface {
Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.ValidatingWebhookConfiguration, error)
Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *validatingWebhookConfigurations) Update(ctx context.Context, validating
}
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("validatingwebhookconfigurations").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("validatingwebhookconfigurations").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -97,15 +97,15 @@ func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutating
}
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &v1beta1.MutatingWebhookConfiguration{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions)
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{})
return err

View File

@@ -97,15 +97,15 @@ func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, valida
}
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions)
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{})
return err

View File

@@ -40,8 +40,8 @@ type MutatingWebhookConfigurationsGetter interface {
type MutatingWebhookConfigurationInterface interface {
Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.MutatingWebhookConfiguration, error)
Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebh
}
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("mutatingwebhookconfigurations").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("mutatingwebhookconfigurations").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ValidatingWebhookConfigurationsGetter interface {
type ValidatingWebhookConfigurationInterface interface {
Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.ValidatingWebhookConfiguration, error)
Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *validatingWebhookConfigurations) Update(ctx context.Context, validating
}
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("validatingwebhookconfigurations").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("validatingwebhookconfigurations").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface {
type ControllerRevisionInterface interface {
Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (*v1.ControllerRevision, error)
Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (*v1.ControllerRevision, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ControllerRevision, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *controllerRevisions) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *controllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type DaemonSetInterface interface {
Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error)
Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error)
UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DaemonSet, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet,
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *daemonSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *daemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *daemonSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *daemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -42,8 +42,8 @@ type DeploymentInterface interface {
Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (*v1.Deployment, error)
Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error)
UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Deployment, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -157,28 +157,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1.Deploymen
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *deployments) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *deployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *deployments) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *deployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &appsv1.ControllerRevision{})
@@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio
}
// DeleteCollection deletes a collection of objects.
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions)
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &appsv1.ControllerRevisionList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *appsv1.Dae
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &appsv1.DaemonSet{})
@@ -123,8 +123,8 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.De
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &appsv1.DaemonSetList{})
return err

View File

@@ -116,7 +116,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *appsv1.D
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &appsv1.Deployment{})
@@ -124,8 +124,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &appsv1.DeploymentList{})
return err

View File

@@ -116,7 +116,7 @@ func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *appsv1.R
}
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &appsv1.ReplicaSet{})
@@ -124,8 +124,8 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &appsv1.ReplicaSetList{})
return err

View File

@@ -116,7 +116,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *appsv1
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &appsv1.StatefulSet{})
@@ -124,8 +124,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.
}
// DeleteCollection deletes a collection of objects.
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions)
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &appsv1.StatefulSetList{})
return err

View File

@@ -42,8 +42,8 @@ type ReplicaSetInterface interface {
Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (*v1.ReplicaSet, error)
Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error)
UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicaSet, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -157,28 +157,28 @@ func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSe
}
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
func (c *replicaSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *replicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("replicasets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *replicaSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *replicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -42,8 +42,8 @@ type StatefulSetInterface interface {
Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (*v1.StatefulSet, error)
Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error)
UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StatefulSet, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -157,28 +157,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.Statefu
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *statefulSets) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *statefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *statefulSets) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *statefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface {
type ControllerRevisionInterface interface {
Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (*v1beta1.ControllerRevision, error)
Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (*v1beta1.ControllerRevision, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerRevision, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *controllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type DeploymentInterface interface {
Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error)
Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error)
UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Depl
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *deployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *deployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta1.ControllerRevision{})
@@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio
}
// DeleteCollection deletes a collection of objects.
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions)
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
@@ -123,8 +123,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
@@ -123,8 +123,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.
}
// DeleteCollection deletes a collection of objects.
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions)
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{})
return err

View File

@@ -41,8 +41,8 @@ type StatefulSetInterface interface {
Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (*v1beta1.StatefulSet, error)
Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error)
UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StatefulSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.St
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *statefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *statefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ControllerRevisionsGetter interface {
type ControllerRevisionInterface interface {
Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (*v1beta2.ControllerRevision, error)
Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (*v1beta2.ControllerRevision, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ControllerRevision, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *controllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *controllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("controllerrevisions").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type DaemonSetInterface interface {
Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (*v1beta2.DaemonSet, error)
Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error)
UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.DaemonSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.Daemon
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *daemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *daemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type DeploymentInterface interface {
Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (*v1beta2.Deployment, error)
Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error)
UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Deployment, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Depl
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *deployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *deployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("deployments").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -103,7 +103,7 @@ func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision
}
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{})
@@ -111,8 +111,8 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, optio
}
// DeleteCollection deletes a collection of objects.
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions)
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.Da
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta2.DaemonSet{})
@@ -123,8 +123,8 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, options *v1.De
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.DaemonSetList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta2.Deployment{})
@@ -123,8 +123,8 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDeployments) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.
}
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta2.ReplicaSet{})
@@ -123,8 +123,8 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta2.StatefulSet{})
@@ -123,8 +123,8 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, options *v1.
}
// DeleteCollection deletes a collection of objects.
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions)
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{})
return err

View File

@@ -41,8 +41,8 @@ type ReplicaSetInterface interface {
Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (*v1beta2.ReplicaSet, error)
Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error)
UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ReplicaSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.Repl
}
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
func (c *replicaSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("replicasets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *replicaSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *replicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("replicasets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type StatefulSetInterface interface {
Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (*v1beta2.StatefulSet, error)
Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error)
UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.StatefulSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -156,28 +156,28 @@ func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.St
}
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
func (c *statefulSets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *statefulSets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("statefulsets").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type AuditSinksGetter interface {
type AuditSinkInterface interface {
Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (*v1alpha1.AuditSink, error)
Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (*v1alpha1.AuditSink, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AuditSink, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AuditSinkList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *auditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSink,
}
// Delete takes name of the auditSink and deletes it. Returns an error if one occurs.
func (c *auditSinks) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *auditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("auditsinks").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *auditSinks) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *auditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("auditsinks").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -97,15 +97,15 @@ func (c *FakeAuditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSi
}
// Delete takes name of the auditSink and deletes it. Returns an error if one occurs.
func (c *FakeAuditSinks) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeAuditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(auditsinksResource, name), &v1alpha1.AuditSink{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeAuditSinks) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOptions)
func (c *FakeAuditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(auditsinksResource, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.AuditSinkList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscalingv1.HorizontalPodAutoscaler{})
@@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string,
}
// DeleteCollection deletes a collection of objects.
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &autoscalingv1.HorizontalPodAutoscalerList{})
return err

View File

@@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface {
Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v1.HorizontalPodAutoscaler, error)
Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error)
UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HorizontalPodAutoscaler, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v2beta1.HorizontalPodAutoscaler{})
@@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string,
}
// DeleteCollection deletes a collection of objects.
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v2beta1.HorizontalPodAutoscalerList{})
return err

View File

@@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface {
Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error)
Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error)
UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error)
List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -115,7 +115,7 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizon
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{})
@@ -123,8 +123,8 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string,
}
// DeleteCollection deletes a collection of objects.
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{})
return err

View File

@@ -41,8 +41,8 @@ type HorizontalPodAutoscalerInterface interface {
Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error)
Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error)
UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error)
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalP
}
// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs.
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("horizontalpodautoscalers").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -115,7 +115,7 @@ func (c *FakeJobs) UpdateStatus(ctx context.Context, job *batchv1.Job, opts v1.U
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *FakeJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batchv1.Job{})
@@ -123,8 +123,8 @@ func (c *FakeJobs) Delete(ctx context.Context, name string, options *v1.DeleteOp
}
// DeleteCollection deletes a collection of objects.
func (c *FakeJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
func (c *FakeJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &batchv1.JobList{})
return err

View File

@@ -41,8 +41,8 @@ type JobInterface interface {
Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error)
Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error)
UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *jobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.Update
}
// Delete takes name of the job and deletes it. Returns an error if one occurs.
func (c *jobs) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *jobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *jobs) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *jobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("jobs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,8 +41,8 @@ type CronJobInterface interface {
Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (*v1beta1.CronJob, error)
Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error)
UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CronJob, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, o
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *cronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *cronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -115,7 +115,7 @@ func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJo
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v1beta1.CronJob{})
@@ -123,8 +123,8 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.Dele
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOptions)
func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.CronJobList{})
return err

View File

@@ -41,8 +41,8 @@ type CronJobInterface interface {
Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (*v2alpha1.CronJob, error)
Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error)
UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CronJob, error)
List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CronJobList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -153,28 +153,28 @@ func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob,
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *cronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *cronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -115,7 +115,7 @@ func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJ
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{})
@@ -123,8 +123,8 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, options *v1.Dele
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCronJobs) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOptions)
func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v2alpha1.CronJobList{})
return err

View File

@@ -41,8 +41,8 @@ type CertificateSigningRequestInterface interface {
Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequest, error)
Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error)
UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequest, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -145,26 +145,26 @@ func (c *certificateSigningRequests) UpdateStatus(ctx context.Context, certifica
}
// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs.
func (c *certificateSigningRequests) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *certificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Resource("certificatesigningrequests").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("certificatesigningrequests").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -20,20 +20,23 @@ import (
"context"
certificates "k8s.io/api/certificates/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
)
type CertificateSigningRequestExpansion interface {
UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error)
UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error)
}
func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) {
func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) {
result = &certificates.CertificateSigningRequest{}
err = c.client.Put().
Resource("certificatesigningrequests").
Name(certificateSigningRequest.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(certificateSigningRequest).
SubResource("approval").
Do(context.TODO()).
Do(ctx).
Into(result)
return
}

View File

@@ -108,15 +108,15 @@ func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certi
}
// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs.
func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(certificatesigningrequestsResource, name), &v1beta1.CertificateSigningRequest{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOptions)
func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestList{})
return err

View File

@@ -17,11 +17,14 @@ limitations under the License.
package fake
import (
"context"
certificates "k8s.io/api/certificates/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
core "k8s.io/client-go/testing"
)
func (c *FakeCertificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) {
func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{})
if obj == nil {

View File

@@ -103,7 +103,7 @@ func (c *FakeLeases) Update(ctx context.Context, lease *coordinationv1.Lease, op
}
// Delete takes name of the lease and deletes it. Returns an error if one occurs.
func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(leasesResource, c.ns, name), &coordinationv1.Lease{})
@@ -111,8 +111,8 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.Delete
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLeases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOptions)
func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &coordinationv1.LeaseList{})
return err

View File

@@ -40,8 +40,8 @@ type LeasesGetter interface {
type LeaseInterface interface {
Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (*v1.Lease, error)
Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (*v1.Lease, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Lease, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *leases) Update(ctx context.Context, lease *v1.Lease, opts metav1.Update
}
// Delete takes name of the lease and deletes it. Returns an error if one occurs.
func (c *leases) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *leases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("leases").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *leases) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *leases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("leases").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -103,7 +103,7 @@ func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.U
}
// Delete takes name of the lease and deletes it. Returns an error if one occurs.
func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(leasesResource, c.ns, name), &v1beta1.Lease{})
@@ -111,8 +111,8 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, options *v1.Delete
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLeases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOptions)
func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.LeaseList{})
return err

View File

@@ -40,8 +40,8 @@ type LeasesGetter interface {
type LeaseInterface interface {
Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (*v1beta1.Lease, error)
Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (*v1beta1.Lease, error)
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Lease, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *leases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.Updat
}
// Delete takes name of the lease and deletes it. Returns an error if one occurs.
func (c *leases) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *leases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("leases").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *leases) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *leases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("leases").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ComponentStatusesGetter interface {
type ComponentStatusInterface interface {
Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (*v1.ComponentStatus, error)
Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (*v1.ComponentStatus, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ComponentStatus, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -129,26 +129,26 @@ func (c *componentStatuses) Update(ctx context.Context, componentStatus *v1.Comp
}
// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs.
func (c *componentStatuses) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *componentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("componentstatuses").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *componentStatuses) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *componentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("componentstatuses").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type ConfigMapsGetter interface {
type ConfigMapInterface interface {
Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error)
Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConfigMap, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *configMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts m
}
// Delete takes name of the configMap and deletes it. Returns an error if one occurs.
func (c *configMaps) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *configMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *configMaps) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *configMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("configmaps").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type EndpointsGetter interface {
type EndpointsInterface interface {
Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error)
Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *endpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts me
}
// Delete takes name of the endpoints and deletes it. Returns an error if one occurs.
func (c *endpoints) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *endpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *endpoints) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *endpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("endpoints").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -40,8 +40,8 @@ type EventsGetter interface {
type EventInterface interface {
Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error)
Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Event, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.Update
}
// Delete takes name of the event and deletes it. Returns an error if one occurs.
func (c *events) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("events").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *events) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("events").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -97,15 +97,15 @@ func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *cor
}
// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs.
func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(componentstatusesResource, name), &corev1.ComponentStatus{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOptions)
func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOpts)
_, err := c.Fake.Invokes(action, &corev1.ComponentStatusList{})
return err

View File

@@ -103,7 +103,7 @@ func (c *FakeConfigMaps) Update(ctx context.Context, configMap *corev1.ConfigMap
}
// Delete takes name of the configMap and deletes it. Returns an error if one occurs.
func (c *FakeConfigMaps) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &corev1.ConfigMap{})
@@ -111,8 +111,8 @@ func (c *FakeConfigMaps) Delete(ctx context.Context, name string, options *v1.De
}
// DeleteCollection deletes a collection of objects.
func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.ConfigMapList{})
return err

View File

@@ -103,7 +103,7 @@ func (c *FakeEndpoints) Update(ctx context.Context, endpoints *corev1.Endpoints,
}
// Delete takes name of the endpoints and deletes it. Returns an error if one occurs.
func (c *FakeEndpoints) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(endpointsResource, c.ns, name), &corev1.Endpoints{})
@@ -111,8 +111,8 @@ func (c *FakeEndpoints) Delete(ctx context.Context, name string, options *v1.Del
}
// DeleteCollection deletes a collection of objects.
func (c *FakeEndpoints) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOptions)
func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.EndpointsList{})
return err

View File

@@ -103,7 +103,7 @@ func (c *FakeEvents) Update(ctx context.Context, event *corev1.Event, opts v1.Up
}
// Delete takes name of the event and deletes it. Returns an error if one occurs.
func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &corev1.Event{})
@@ -111,8 +111,8 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, options *v1.Delete
}
// DeleteCollection deletes a collection of objects.
func (c *FakeEvents) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.EventList{})
return err

View File

@@ -103,7 +103,7 @@ func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *corev1.LimitRa
}
// Delete takes name of the limitRange and deletes it. Returns an error if one occurs.
func (c *FakeLimitRanges) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeLimitRanges) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(limitrangesResource, c.ns, name), &corev1.LimitRange{})
@@ -111,8 +111,8 @@ func (c *FakeLimitRanges) Delete(ctx context.Context, name string, options *v1.D
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOptions)
func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.LimitRangeList{})
return err

View File

@@ -108,7 +108,7 @@ func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *corev1.Nam
}
// Delete takes name of the namespace and deletes it. Returns an error if one occurs.
func (c *FakeNamespaces) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(namespacesResource, name), &corev1.Namespace{})
return err

View File

@@ -17,11 +17,14 @@ limitations under the License.
package fake
import (
"context"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
core "k8s.io/client-go/testing"
)
func (c *FakeNamespaces) Finalize(namespace *v1.Namespace) (*v1.Namespace, error) {
func (c *FakeNamespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Resource = namespacesResource

View File

@@ -108,15 +108,15 @@ func (c *FakeNodes) UpdateStatus(ctx context.Context, node *corev1.Node, opts v1
}
// Delete takes name of the node and deletes it. Returns an error if one occurs.
func (c *FakeNodes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(nodesResource, name), &corev1.Node{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeNodes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(nodesResource, listOptions)
func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts)
_, err := c.Fake.Invokes(action, &corev1.NodeList{})
return err

View File

@@ -108,15 +108,15 @@ func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolu
}
// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs.
func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(persistentvolumesResource, name), &corev1.PersistentVolume{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOptions)
func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOpts)
_, err := c.Fake.Invokes(action, &corev1.PersistentVolumeList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persisten
}
// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs.
func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(persistentvolumeclaimsResource, c.ns, name), &corev1.PersistentVolumeClaim{})
@@ -123,8 +123,8 @@ func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, op
}
// DeleteCollection deletes a collection of objects.
func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOptions)
func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.PersistentVolumeClaimList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakePods) UpdateStatus(ctx context.Context, pod *corev1.Pod, opts v1.Up
}
// Delete takes name of the pod and deletes it. Returns an error if one occurs.
func (c *FakePods) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakePods) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podsResource, c.ns, name), &corev1.Pod{})
@@ -123,8 +123,8 @@ func (c *FakePods) Delete(ctx context.Context, name string, options *v1.DeleteOp
}
// DeleteCollection deletes a collection of objects.
func (c *FakePods) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOptions)
func (c *FakePods) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.PodList{})
return err

View File

@@ -17,13 +17,16 @@ limitations under the License.
package fake
import (
"context"
"k8s.io/api/core/v1"
policy "k8s.io/api/policy/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
restclient "k8s.io/client-go/rest"
core "k8s.io/client-go/testing"
)
func (c *FakePods) Bind(binding *v1.Binding) error {
func (c *FakePods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Namespace = binding.Namespace
@@ -57,7 +60,7 @@ func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Requ
return &restclient.Request{}
}
func (c *FakePods) Evict(eviction *policy.Eviction) error {
func (c *FakePods) Evict(ctx context.Context, eviction *policy.Eviction) error {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Namespace = c.ns

View File

@@ -103,7 +103,7 @@ func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *corev1.PodTe
}
// Delete takes name of the podTemplate and deletes it. Returns an error if one occurs.
func (c *FakePodTemplates) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podtemplatesResource, c.ns, name), &corev1.PodTemplate{})
@@ -111,8 +111,8 @@ func (c *FakePodTemplates) Delete(ctx context.Context, name string, options *v1.
}
// DeleteCollection deletes a collection of objects.
func (c *FakePodTemplates) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOptions)
func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.PodTemplateList{})
return err

View File

@@ -116,7 +116,7 @@ func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicati
}
// Delete takes name of the replicationController and deletes it. Returns an error if one occurs.
func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(replicationcontrollersResource, c.ns, name), &corev1.ReplicationController{})
@@ -124,8 +124,8 @@ func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, op
}
// DeleteCollection deletes a collection of objects.
func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOptions)
func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.ReplicationControllerList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *co
}
// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs.
func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(resourcequotasResource, c.ns, name), &corev1.ResourceQuota{})
@@ -123,8 +123,8 @@ func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, options *v
}
// DeleteCollection deletes a collection of objects.
func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOptions)
func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.ResourceQuotaList{})
return err

View File

@@ -103,7 +103,7 @@ func (c *FakeSecrets) Update(ctx context.Context, secret *corev1.Secret, opts v1
}
// Delete takes name of the secret and deletes it. Returns an error if one occurs.
func (c *FakeSecrets) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeSecrets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &corev1.Secret{})
@@ -111,8 +111,8 @@ func (c *FakeSecrets) Delete(ctx context.Context, name string, options *v1.Delet
}
// DeleteCollection deletes a collection of objects.
func (c *FakeSecrets) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.SecretList{})
return err

View File

@@ -115,7 +115,7 @@ func (c *FakeServices) UpdateStatus(ctx context.Context, service *corev1.Service
}
// Delete takes name of the service and deletes it. Returns an error if one occurs.
func (c *FakeServices) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &corev1.Service{})

View File

@@ -104,7 +104,7 @@ func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *corev1
}
// Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs.
func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(serviceaccountsResource, c.ns, name), &corev1.ServiceAccount{})
@@ -112,8 +112,8 @@ func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, options *
}
// DeleteCollection deletes a collection of objects.
func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOptions)
func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &corev1.ServiceAccountList{})
return err

View File

@@ -40,8 +40,8 @@ type LimitRangesGetter interface {
type LimitRangeInterface interface {
Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (*v1.LimitRange, error)
Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (*v1.LimitRange, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LimitRange, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -136,28 +136,28 @@ func (c *limitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opt
}
// Delete takes name of the limitRange and deletes it. Returns an error if one occurs.
func (c *limitRanges) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *limitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *limitRanges) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *limitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("limitranges").
VersionedParams(&listOptions, scheme.ParameterCodec).
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -41,7 +41,7 @@ type NamespaceInterface interface {
Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error)
Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error)
UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error)
Delete(ctx context.Context, name string, opts *metav1.DeleteOptions) error
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
@@ -144,11 +144,11 @@ func (c *namespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace,
}
// Delete takes name of the namespace and deletes it. Returns an error if one occurs.
func (c *namespaces) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
func (c *namespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Resource("namespaces").
Name(name).
Body(options).
Body(&opts).
Do(ctx).
Error()
}

View File

@@ -20,16 +20,18 @@ import (
"context"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
)
// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface.
type NamespaceExpansion interface {
Finalize(item *v1.Namespace) (*v1.Namespace, error)
Finalize(ctx context.Context, item *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error)
}
// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs.
func (c *namespaces) Finalize(namespace *v1.Namespace) (result *v1.Namespace, err error) {
func (c *namespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) {
result = &v1.Namespace{}
err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do(context.TODO()).Into(result)
err = c.client.Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result)
return
}

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