Commit Graph

3436 Commits

Author SHA1 Message Date
Nic Cope
735524f850 Use sha256 to sanitize discovery HTTP cache keys
This helps avoid (potentially malicious) collisions when reading and
writing cache data.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: 288a17fd337c65cb5aea44e44ecb74e9cb8088f5
2022-07-14 14:11:33 -07:00
Nic Cope
1ea239faa5 Use checksums instead of fsyncs to manage discovery cache corruption
Part of the API discovery cache uses an HTTP RoundTripper that
transparently caches responses to disk. The upstream implementation of
the disk cache is hard coded to call Sync() on every file it writes.
This has noticably poor performance on modern Macs, which ask their disk
controllers to flush all the way to persistant storage because Go uses
the `F_FULLFSYNC` fnctl. Apple recommends minimizing this behaviour in
order to avoid degrading performance and increasing disk wear.

The content of the discovery cache is not critical; it is indeed just a
cache and can be recreated by hitting the API servers' discovery
endpoints. This commit replaces upstream httpcache's diskcache
implementation with a similar implementation that can use CRC-32
checksums to detect corrupted cache entries at read-time. When such an
entry is detected (e.g. because it was only partially flushed to
permanent storage before the host lost power) the cache will report a
miss. This causes httpcache to fall back to its underlying HTTP
transport (i.e. the real API server) and re-cache the resulting value.

Apart from adding CRC-32 checksums and avoiding calling fsync this
implementation differs from upstream httpcache's diskcache package in
that it uses FNV-32a hashes rather than MD5 hashes of cache keys in
order to generate filenames.

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: 7a2c6a432f9e8db8b84abe5607843429f8bff417
2022-06-28 19:15:49 -07:00
Nic Cope
76fccca0ea Add a benchmark for the discovery cache RoundTripper
This benchmark is intended to demonstrate a performance improvement
gained by removing fsyncs. Refer to the below issue for more detail.

https://github.com/kubernetes/kubernetes/issues/110753

Signed-off-by: Nic Cope <nicc@rk0n.org>

Kubernetes-commit: eace46906512b99c23ad9635edc2ea055363a602
2022-06-28 19:40:58 -07:00
Kubernetes Publisher
ec0f33729d Merge pull request #111387 from marseel/feature/retry_internal_errors
Add option to retry internal api error in reflector.

Kubernetes-commit: 79a62d62350fb600f97d1f6309c3274515b3587a
2022-07-28 16:16:03 +00:00
Kubernetes Publisher
c2d2c47718 Merge pull request #111228 from Abirdcfly/220716
clean unreachable code

Kubernetes-commit: 4e5711829c1c8bfadbb7632b28def5ba08325132
2022-07-27 20:05:57 +00:00
Kubernetes Publisher
fe12e65afd Merge pull request #111442 from ialidzhikov/k8s-utils@56c0de1e6f
Update `k8s.io/utils` to `9bab9ef40391`

Kubernetes-commit: e092b6d27bff004171b71fffa45f111fdcd6e81b
2022-07-27 20:05:55 +00:00
ialidzhikov
7a55c3b96b Update k8s.io/utils to 9bab9ef40391
Kubernetes-commit: 168fef6845f50f0460e7bdc0280da480cc92b787
2022-07-26 18:43:20 +03:00
Kubernetes Publisher
cc879cd5b6 Merge pull request #111254 from dims/update-to-golang-1.19-rc2
[golang] Update to 1.19rc2 (from 1.18.3)

Kubernetes-commit: 3ffdfbe286ebcea5d75617da6accaf67f815e0cf
2022-07-27 00:05:46 +00:00
Kubernetes Publisher
b5c7588f8a Merge pull request #109141 from ulucinar/bump-discovery-burst
Bump default burst limit for discovery client to 300

Kubernetes-commit: 5ac563c507cd75c9382a2a23a3c8e3452138a021
2022-07-26 20:05:51 +00:00
Marcel Zięba
ff6bf679aa Add option to retry internal api error in reflector.
Kubernetes-commit: 0b2b6489de8f75d5299f54180617601126bb8878
2022-07-25 08:02:54 +00:00
Kubernetes Publisher
b2097e607c Merge pull request #110666 from ldsdsy/modify
Fix some syntax errors under the staging/src/k8s.io/client-go/rest/ folder

Kubernetes-commit: 6db9d882387eb2a0b5d78deffac88a121ceac9f3
2022-07-22 16:22:34 +00:00
Kubernetes Publisher
4db4856058 Merge pull request #111242 from wojtek-t/fix_leaking_goroutines_11
Fix leaking goroutines in multiple integration tests

Kubernetes-commit: 0cde1b744652306e921116883e2465a005b79811
2022-07-22 16:22:31 +00:00
Kubernetes Publisher
95a40e254c Merge pull request #110178 from kevindelgado/validation-beta-1-25
Graduate server side validation to beta

Kubernetes-commit: eeb12bb3af3361c9ac652be071c3b9cf49aa5e58
2022-07-22 16:22:30 +00:00
Kubernetes Publisher
267b6570f5 Merge pull request #111235 from Abirdcfly/220719
fix a possible panic because of taking the address of nil

Kubernetes-commit: e234917e0a3e4bb384ef14c198742643a7e170fd
2022-07-22 16:22:27 +00:00
Kubernetes Publisher
0cfc9635b9 Merge pull request #110649 from harshanarayana/fix/GIT-110335-fix-fake-event-expansion
client-go: Modify FakeEvents to Work Event Sink started with `""` namespace

Kubernetes-commit: 0e7bb163e38cde20712ce29e918e10ec5c82f3eb
2022-07-22 16:22:26 +00: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
Abirdcfly
ca60e0ea14 fix a possible panic because of taking the address of nil
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: c8c2819a4d7327f33a143f65c6af2bff5ef49735
2022-07-19 10:39:08 +08:00
Wojciech Tyczyński
9dde02d660 Clean shutdown of client integration tests
Kubernetes-commit: f673c262bdc2f3f0f060a2ed4349b723a088f36a
2022-07-18 21:13:33 +02:00
Abirdcfly
65b1e7d3c0 clean Unreachable code
Signed-off-by: Abirdcfly <fp544037857@gmail.com>

Kubernetes-commit: f71718d6448418d0289b9649905a16bfb1962b68
2022-07-19 00:58:17 +08:00
Kubernetes Publisher
c6bd30b9ec Merge pull request #111176 from p0lyn0mial/upstream-cacher-refactor-for-streaming
refactor the reflector to pave the way for streaming

Kubernetes-commit: d96891255f0a15c5c992ba38ab3cf782eda66fdf
2022-07-15 21:11:11 +00:00
Lukasz Szaszkiewicz
441e2c8c97 reflector: simplify reading the resourceVersion
Kubernetes-commit: 63b125d4061d267ad8998ea30e054bb1445b1a5a
2022-07-15 10:14:26 +02:00
Alper Rifat Ulucinar
4aac6a7c9c Bump discovery burst of default ConfigFlags to 300
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

Kubernetes-commit: 45f653e3db6a120d7cafaf2a9262fb3c8a2e22a2
2022-07-14 09:58:55 +03:00
Kevin Delgado
b4c3510afd update kjson
Kubernetes-commit: c210483cf02768c3f2eaf42e13844c5d821831ba
2022-07-13 16:05:45 +00:00
Lukasz Szaszkiewicz
04f67d5d4f reflector: move LIST to its own method
Kubernetes-commit: 6fc09008def0b63fdd31bd26a14f7fcd3ed63c7e
2022-06-24 16:25:08 +02:00
Lukasz Szaszkiewicz
4e28921c86 reflector: refactor watchHandler
Kubernetes-commit: e9e26068b746315b616a26b91ff2613f98e934bc
2022-06-24 13:44:32 +02:00
Kubernetes Publisher
163ee0b6d7 Merge pull request #111080 from zhoumingcheng/master-v3
Correct wrong syntax

Kubernetes-commit: 3b4d2a9b315be29f600c4eae704d62107fd5ff98
2022-07-15 21:11:09 +00:00
Kubernetes Publisher
743e29dc1f Merge pull request #111008 from cici37/bumpCEL
Bump cel-go to v0.12.3

Kubernetes-commit: 19a22f763770d1208dca2b8d50513ac805f7fe14
2022-07-14 13:11:01 +00:00
Kubernetes Publisher
79a582f2eb Merge pull request #111097 from saltbo/fix-thethe-typo
fix: update the typo code comment

Kubernetes-commit: f3654386abbb838c42286250ef52a73c52ab1812
2022-07-14 01:23:24 +00:00
Kubernetes Publisher
eabd4289b0 Merge pull request #111002 from HecarimV/fix-220707
fix static-check for staging/src/k8s.io/client-go/

Kubernetes-commit: 09e8339ae4e575ec40e8ed0fc2829fcb678c0f19
2022-07-13 09:22:58 +00:00
saltbo
7c3fa18b11 fix: update the typo code comment
Kubernetes-commit: d2bab218ddef3fc3f444038420dd500c0e8bc068
2022-07-13 10:16:51 +08:00
Kubernetes Publisher
59fda2e669 Merge pull request #111087 from HecarimV/fix-22071205
Fix: import the same package multiple times

Kubernetes-commit: d46399f788fbb8de586cd71c19d1e49bfae8659f
2022-07-12 17:29:46 +00: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
zhoumingcheng
84e1219642 Correct some wrong syntax
Signed-off-by: zhoumingcheng <zhoumingcheng@beyondcent.com>

Kubernetes-commit: e590ab77dcb68486a154b755aae658509b9290ea
2022-07-12 10:46:56 +08:00
Kubernetes Publisher
3b969f9680 Merge pull request #111001 from pohly/klog-update
build: update to klog v2.70.1

Kubernetes-commit: 8e62fd24b073296c4cfd8f8d966d5922b6d9022c
2022-07-08 01:23:16 +00:00
Cici Huang
7f7dbbc80a Bump cel-go to v0.12.0
Kubernetes-commit: 772a252b06da86955d30d7b935dc4dba84fdc328
2022-07-07 17:13:57 +00: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
Patrick Ohly
26b506437f build: update to klog v2.70.1
This makes ktesting more resilient against logging from leaked goroutines,
which is a problem that came up in kubelet node shutdown
tests (https://github.com/kubernetes/kubernetes/issues/110854).

Kubernetes-commit: 3581e308835c69b11b2c9437db44073129e0e2bf
2022-07-07 12:54:08 +02:00
Kubernetes Publisher
506ef8944c Merge pull request #110990 from thockin/svc-typenames-IPFamilyPolicyType
Rename IPFamilyPolicyType => IPFamilyPolicy

Kubernetes-commit: e8eb7a5e1906ec07f5e666a2d2f32f3a0e74dcec
2022-07-07 05:29:22 +00:00
ldsdsy
123d4e7e38 Fix a typo
Kubernetes-commit: bfe61fa574321474c4b278afb39af95464efad43
2022-06-20 21:52:50 +08:00
Harsha Narayana
e2ef40870b GIT-110335: address namespace defaulting for events
Kubernetes-commit: 85e74aa3122114ac7e82c3044f387d03661063e4
2022-06-18 21:52:50 +05:30
Alper Rifat Ulucinar
ed7d154cc2 Bump default burst limit for discovery client to 300
Signed-off-by: Alper Rifat Ulucinar <ulucinar@users.noreply.github.com>

Kubernetes-commit: 534427f5d3134189f49e6811a7642b86cf92c55a
2022-03-30 11:19:41 +03:00
Tim Hockin
61a7d9d6e1 Rename IPFamilyPolicyType => IPFamilyPolicy
Kubernetes-commit: 55232e2ef773423ed9b3321b38fc438f85cd690c
2021-11-09 23:09:35 -08:00
Kubernetes Publisher
a16e76eb69 Merge pull request #110831 from chendave/openapi
Bump `kube-openapi` to the latest

Kubernetes-commit: 8a7eda4f610f7003bf096d870531c7583751674e
2022-06-30 19:56:35 +00:00
Dave Chen
6a58c3a5c7 Bump kube-openapi to the latest
This will help us to get rid of `Ginkgo` v1 dep.

Signed-off-by: Dave Chen <dave.chen@arm.com>

Kubernetes-commit: 597071af17377f5ab4de03804b0d8b41f73fe7ce
2022-06-28 15:59:50 +08:00
Kubernetes Publisher
f5b6af4563 Merge pull request #110788 from 21kyu/change_reflect_ptr
Change reflect.Ptr to reflect.Pointer

Kubernetes-commit: 10810ab42bc8acde6732feae545aa34a09ecd299
2022-06-27 19:52:45 +00:00
21kyu
1b23c1577a Change reflect.Ptr to reflect.Pointer
Kubernetes-commit: df168d5b5c2dab7414fc00ead1a51257ec326a98
2022-06-26 01:23:43 +09:00
Kubernetes Publisher
8dfe88aeff Merge pull request #110724 from pohly/klog-update
build: update to klog v2.70.0

Kubernetes-commit: ddfbb5bdbef1febda92fdc4ee4666f5339d1f729
2022-06-23 03:53:28 +00:00
Kubernetes Publisher
899bcd7409 Merge pull request #110425 from LY-today/fake-evict-list-err
fix: list pod err after an pod evicted

Kubernetes-commit: 1d811065345bfe9f3be7f6757a9938c1760180c7
2022-06-22 23:52:40 +00:00
Kubernetes Publisher
0647d43372 Merge pull request #109632 from weilaaa/recorrect_byindex_input_param
correct input params of ByIndex

Kubernetes-commit: e2fe430da77da01aa5b4c9bd787d46062f1500a0
2022-06-22 19:53:10 +00:00
LY-today
9ac8bfecbb fix: list pod err after an pod evicted
Signed-off-by: LY-today <724102053@qq.com>

Kubernetes-commit: f299494e7977a935511208eb91001508b4b629ce
2022-06-22 23:30:40 +08:00