Commit Graph

211 Commits

Author SHA1 Message Date
Etienne Champetier
5d715fe8c7 client-go: allow to set NotBefore in NewSelfSignedCACert()
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>

Kubernetes-commit: a85d04f86172369202efabd86d7b815f8b79c3ff
2023-06-28 00:01:34 -04:00
Min Ni
c4c506ff2e update serial number to a valid non-zero number in ca certificate
Kubernetes-commit: 26285c1d6685720002464ce3660b44094568c21d
2023-05-08 16:39:35 -07:00
Alexander Zielenski
898b7a3cbd add FindFieldsOwners util function
to be used by kubectl to determine csa manager name used

findowners

Kubernetes-commit: 26a6e1234869b5c546195aaf416f3424cd3c3dc8
2022-11-03 12:01:34 -07:00
Alexander Zielenski
4f63b629b5 add UpgradeManagedFieldsPatch
rather than modify the object directly, this function provides a JSONPATCH that should be sent to the server to upgrade its managed fields.

Kubernetes-commit: 4e4d748c06e2c2dfec7608f96237c4b0a42540c9
2022-11-03 17:38:08 -07:00
Alexander Zielenski
c8c6cb5745 add OWNERS to csaupgrade
Kubernetes-commit: 5002ba215bcaec75a65ccd1ee879c64538b970b7
2022-11-03 17:38:02 -07:00
Alexander Zielenski
a45874a99b remove kubectl annotation logic from upgrade patch
adds unneccessary complexity. also discussed in SIG CLI meeting to keep annotation around for a while longer

Kubernetes-commit: 0c055eae3c9eaea26574743f0623d6b0e9e3d6b4
2022-11-03 12:05:45 -07:00
Alexander Zielenski
12cafe2b1b refactor to use Schema(contentType)
Kubernetes-commit: e6e6dd826d76a2b19515cd907062f1f74f9e52c2
2022-10-14 12:46:36 -07:00
Alexander Zielenski
00d892f447 correct spacing
Kubernetes-commit: dbff8e117c8d4aeccac6ea211dfa334e30621727
2022-09-06 20:58:50 -07:00
Alexander Zielenski
2efbeaf56e add boilerplate
Kubernetes-commit: 3528fd7e47f585c144b13c0c2b75bc4e432987c6
2022-09-06 19:51:47 -07:00
Alexander Zielenski
dac0826f18 remove inaccurate comment
Kubernetes-commit: 52fcd20b578b67234a9ac84b5abf1cd2b3d06ea4
2022-09-02 17:42:08 -07:00
Alexander Zielenski
7634f2e002 make upgrade modify input instead of deep copying
Kubernetes-commit: adcb5ec3d43908a916fd1ae75af121568f26b80d
2022-09-02 17:40:34 -07:00
Alexander Zielenski
9aa7c11460 remove fieldsv1 from upgrade body
Kubernetes-commit: 5c9534b9cfdcfa9625153051f0859e101abb97a9
2022-09-02 17:38:29 -07:00
Alex Zielenski
703d15eff6 Update staging/src/k8s.io/client-go/util/csaupgrade/upgrade.go
Co-authored-by: Antoine Pelisse <apelisse@gmail.com>

Kubernetes-commit: 5caffef694b50168f546d7758a26de832302b541
2022-09-02 17:34:07 -07:00
Alexander Zielenski
675ca93180 refactor if statement
Kubernetes-commit: f7defeecce9c9e32d180deb2a2c67e063a10265f
2022-08-30 15:46:43 -07:00
Alexander Zielenski
cfaca90a30 address comments
Kubernetes-commit: e8d8eb4381f96ec4923a801116050ee998de4887
2022-08-30 13:21:29 -07:00
Alexander Zielenski
089614c43e remove last applied configuration information
Kubernetes-commit: a7fe0f0283765e4970211f7227602e2caa4b3a57
2022-08-24 12:31:57 -07:00
Alexander Zielenski
efe378914a add more test cases
Kubernetes-commit: 42c960497a4737d8147d40d436a00be81ec4248d
2022-08-24 11:51:30 -07:00
Alexander Zielenski
46dc22f46a clean up test
Kubernetes-commit: 8f6d7f1fa13db3d7a3354a13f014e1ce7acabda0
2022-08-24 10:24:05 -07:00
Alexander Zielenski
ced85a8521 update godoc
Kubernetes-commit: f94ef92f2ac44fb07bc8d75d5f250b757b343c11
2022-08-24 10:12:41 -07:00
Alexander Zielenski
049ba69f2f expose FieldsToSet and SetToFields
Kubernetes-commit: a338fff435c35a4da2556a8f4c4ab059c98e909c
2022-08-24 10:03:16 -07:00
Alexander Zielenski
aa892ab1ac remove unused code
Kubernetes-commit: f495d7656ca79e2d5cae03b37977e75369352645
2022-08-23 16:17:27 -07:00
Alexander Zielenski
90ef078c30 dont expose internal methods in implementatoin
Kubernetes-commit: fe2b5d00f2c1f16636638acd10b8d640e6de22c9
2022-08-23 16:12:47 -07:00
Alexander Zielenski
c364b639fb add function to upgrade managedfields CSA to SSA
Kubernetes-commit: 27cd307e23df3a2d508d52ff10ac8f46bf3bcea3
2022-08-22 16:42:18 -07:00
inosato
27de641f75 Remove ioutil from client-go
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 88dfa51b6003c90e8f0a0508939a1d79950a40df
2022-07-30 20:54:41 +09:00
Aldo Culquicondor
3dfaef50d7 Add clock interface to disruption controller
To be able to write more precise unit tests in the future

Change-Id: I8f45947dfacca501acd856849bd978fad0f735cd

Kubernetes-commit: dad8454ebb87ba7af897537db6d34033127bbfef
2022-07-26 15:11:53 -04:00
Davanum Srinivas
2a6c116e40 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
HaoJie Liu
f295032991 fix static-check for staging/src/k8s.io/client-go/
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>

Kubernetes-commit: 6022b69dfd1c6e9454d4aa79012803c749706f6d
2022-07-07 18:58:25 +08:00
HaoJie Liu
2f582c2a40 Fix:import the same package multiple times
Signed-off-by: HaoJie Liu <liuhaojie@beyondcent.com>

Kubernetes-commit: 4f0a0ec81c649727cfc62cf8c0a2ad7eabf12516
2022-07-12 17:41:37 +08:00
cncal
152e68ff13 Remove the duplicate code snippet in client-go delaying_queue tests
Kubernetes-commit: af438abbf332e26e2f3f729627bf9764c9b1feef
2022-04-17 15:55:33 +08:00
Alexander Zielenski
018cf8ace6 add fetching into discovery client for OpenAPI v3
reflect latest struct changes

use correct discovery openapi test data layout

make the OpenAPIv3 interface less blue

field grouping

add copyrights

implement cached discovery client

add cached discovery tests

address review feedback

Kubernetes-commit: 075866b3e3ea029c243d82d8d6eb99e96d9c49d3
2022-03-22 10:40:56 -07:00
Wojciech Tyczyński
a806c6e4fd Remove selflink references in different testing-related files
Kubernetes-commit: 551790729f1d26d75c1d3fa1411e341eb367f9f3
2022-01-13 11:33:26 +01:00
Spencer Peterson
5a537879c2 Document when workqueue metrics are dropped
Two simple choices for workqueues do not document that they do not emit
metrics. Using their named variants fixes this, but was undocumented.

Change-Id: I100ad08a4859513987941ed35d12abb4cbb39873

Kubernetes-commit: f468bee672b0ccf9b97a85f17ec1f5645aced926
2021-12-09 16:59:54 -08:00
Davanum Srinivas
70f09c4943 Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
Abu Kashem
4b3bec4f5d client-go: add jitter to flowcontrol.Backoff
Kubernetes-commit: ec93e854ca0924b7f984641b0bbdefc12b269f2b
2021-11-08 19:30:03 -05:00
Karthik K N
881e30ae78 Changes to fix the flake test case in ratelimiter
Kubernetes-commit: 7134657304a6d5b3a62c51cad82af6ca703d40c4
2021-09-28 12:23:27 +05:30
Madhav Jivrajani
b9fa896d5d Refactor client-go/util/flowcontrol/throttle.go RateLimiter
- Introduce PassiveRateLimiter which implements all methods of previous RateLimiter except Accept() and Wait()
- Change RateLimiter interface to extend PassiveRateLimiter by additionally implementing Accept() and Wait()
- Make client-go/tools/record use PassiveRateLimiter

Refactor EventSourceObjectSpamFilter, EventAggregator, EventCorrelator

- EventSourceObjectSpamFilter, EventAggregator, EventCorrelator use clock.PassiveClock now.
	- This won't be a breaking change because even if a clock.Clock is passed, it still implements the clock.PassiveClock interface.
- Extend clock.PassiveClock through Clock.
- Replace pacakge local implementation of realClock with clock.RealClock
- In flowcontrol/throttle.go split tokenBucketRateLimiters to use Clock and clock.PassiveClock.
- Migrate client-go/tools/record tests from using IntervalClock to using SimpleIntervalClock (honest implementation of clock.PassiveClock)

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: ac5c55f0bd853fcf883d9b8e1f5ef728a2fb5309
2021-08-25 21:56:26 +05:30
luyou86
a6277bbabf client-go bucket rate limiter add maxDelay
Kubernetes-commit: 57ec8336195702dd0d5f6f19fd3907e2a6a615a8
2021-08-29 17:45:58 +08:00
John Howard
eb364c77d8 workqueue: fix leak in queue preventing objects from being GCed
See https://github.com/grpc/grpc-go/issues/4758 for a real world example
of this leaking 2gb+ of data.

Basically, when we do `q.queue[1:]` we are just repositioning the slice.
The underlying array is still active, which contains the object formerly
known as `q.queue[0]`. Because its referencing this object, it will not
be GCed. The only thing that will trigger it to free is eventually when
we add enough to the queue that we allocate a whole new array.

Instead, we should explicitly clear out the old space when we remove it
from the queue. This ensures the object can be GCed, assuming the users'
application doesn't reference it anymore.

Kubernetes-commit: 2a34801168dc1c70ba25b1d4200b534bf515cbc2
2021-09-14 15:51:09 -07:00
xuzhonghu
2f21912570 Fix workqueue memory leak
Kubernetes-commit: 25060beef0c536e80b53507ec445695a7305db00
2021-09-14 09:53:53 +08:00
wojtekt
8d49a0b940 Migrate to k8s.io/utils/clock in flowcontrol backoff
Kubernetes-commit: 4ce452989bef21ab6d15bc659f463d8c706ad33e
2021-09-10 09:37:30 +02:00
wojtekt
14a51589c3 Migratet to k8s.io/utils/clock in workqueue
Kubernetes-commit: 392292ba81964e6ee7badec360a800b1f8645f2f
2021-09-09 16:38:59 +02:00
Alexander Constantinescu
22aa998def [queue] Implement ShutDownWithDrain allowing the queue to drain when shutting down
Signed-off-by: Alexander Constantinescu <aconstan@redhat.com>

Kubernetes-commit: 5b740f430e0a4892e9db3a1fea9f349a06267755
2021-05-12 02:26:22 +02:00
atiratree
e529a15dbc add a test for jsonpath template parsing to prevent regressions
This behaviour was broken by commit
39cfe232325d66bcdbc935af7aaf7022562e7010 and PR kubernetes#98057

Kubernetes-commit: b79859cb12b19222fffc17481e1fe006819de63c
2021-08-26 14:49:58 +02:00
atiratree
496c390182 revert "fix wrong output when using jsonpath"
This partially reverts commit 39cfe232325d66bcdbc935af7aaf7022562e7010and PR #98057

the original problem was caused by not using {end} at the end of the range

Kubernetes-commit: 5c3de9f1de913d1251ce2183991a845edc01d123
2021-08-05 18:39:43 +02:00
astraw99
9d15ff74ca fix typo of rate limiter
Kubernetes-commit: 7953cf0ce9f890b6cba7de3325a7ce68609832a0
2021-08-15 17:48:37 +08:00
Antonio Ojea
a6edfabde7 run hack/update-netparse-cve.sh
Kubernetes-commit: 0cd75e8fec62a2531637e80bb950ac9983cac1b0
2021-08-20 01:16:14 +02:00
Tomáš Kukrál
5783ea1040 fix typo in retry doc
Kubernetes-commit: 1dc4a29a1aed89b598cb728986526d00390cdadc
2021-03-19 17:28:28 +01:00
Tim Hockin
bcf88f084d Update golang.org/x/time/rate (#104014)
* Add failing test case

* Update golang.org/x/time/rate

* Call update-internal-modules from update-vendor

Kubernetes-commit: 09dc055984e9532f29f37acae7aea7a979ded764
2021-07-30 02:27:36 +00:00
Monis Khan
30cd4e9a49 csr: add expirationSeconds field to control cert lifetime
This change updates the CSR API to add a new, optional field called
expirationSeconds.  This field is a request to the signer for the
maximum duration the client wishes the cert to have.  The signer is
free to ignore this request based on its own internal policy.  The
signers built-in to KCM will honor this field if it is not set to a
value greater than --cluster-signing-duration.  The minimum allowed
value for this field is 600 seconds (ten minutes).

This change will help enforce safer durations for certificates in
the Kube ecosystem and will help related projects such as
cert-manager with their migration to the Kube CSR API.

Future enhancements may update the Kubelet to take advantage of this
field when it is configured in a way that can tolerate shorter
certificate lifespans with regular rotation.

Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: cd91e59f7c351fce47c064a5162c2cb79075159c
2021-06-25 22:08:10 -04:00
Robin Černín
b6d16d4e18 [jsonpath] fix wrong output when using jsonpath
Fix range loop when using jsonpath

Without patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running
 is Running

With patch:

kubectl get -n openshift-oauth-apiserver po -o jsonpath='{range .items[?(.status.phase=="Running")]}{.metadata.name}{" is Running\n"}'
apiserver-7d9cc97649-79c2x is Running
apiserver-7d9cc97649-lgks6 is Running
apiserver-7d9cc97649-qgkxn is Running

Kubernetes-commit: 39cfe232325d66bcdbc935af7aaf7022562e7010
2021-01-14 19:53:59 +10:00