Commit Graph

113884 Commits

Author SHA1 Message Date
mantuliu
bc70548c47 Remove unused code
Signed-off-by: mantuliu <240951888@qq.com>
2023-02-14 20:08:11 +08:00
Kubernetes Prow Robot
5ad9e41879
Merge pull request #114987 from astefanutti/pr-codegen-applyconfig
Add applyconfiguration generator to code-generator script
2023-02-14 03:19:30 -08:00
Patrick Ohly
f131cabfa0 test: use go-uber/goleak for strict leak checking
It provides more readable output and has additional APIs for using it inside a
unit test. goleak.IgnoreCurrent is needed to filter out the goroutine that gets
started when importing go.opencensus.io/stats/view.

In order to handle background goroutines that get created on demand and cannot
be stopped (like the one for LogzHealth), a helper function ensures that those
are running before calling goleak.IgnoreCurrent. Keeping those goroutines
running is not a problem and thus not worth the effort of adding new APIs to
stop them.

Other goroutines are genuine leaks for which no fix is available. Those get
suppressed via IgnoreTopFunction, which works as long as that function
is unique enough.

Example output for the leak fixed in https://github.com/kubernetes/kubernetes/pull/115423:

    E0202 09:30:51.641841   74789 etcd.go:205] "EtcdMain goroutine check" err=<
        found unexpected goroutines:
        [Goroutine 4889 in state chan receive, with k8s.io/apimachinery/pkg/watch.(*Broadcaster).loop on top of the stack:
        goroutine 4889 [chan receive]:
        k8s.io/apimachinery/pkg/watch.(*Broadcaster).loop(0xc0076183c0)
        	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/watch/mux.go:268 +0x65
        created by k8s.io/apimachinery/pkg/watch.NewBroadcaster
        	/nvme/gopath/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/watch/mux.go:77 +0x116
    >
2023-02-14 12:11:37 +01:00
Kubernetes Prow Robot
5d9d06aa47
Merge pull request #115717 from pacoxu/node-dns-v1.22.17
update node-local-dns to v1.22.17
2023-02-13 23:43:30 -08:00
Li Bo
2d98d2412a refine code 2023-02-14 15:10:54 +08:00
Sean Sullivan
869da89eab Refactor fake versions of openapi client into testing subdir 2023-02-13 17:43:01 -08:00
Paco Xu
ceb37c3a5c update node-local-dns to 1.22.18 2023-02-14 09:37:35 +08:00
Kubernetes Prow Robot
d0e927e7bf
Merge pull request #115737 from Nordix/uablrek-ipvs-owner
Add uablrek in pkg/util/ipvs/OWNERS
2023-02-13 15:57:41 -08:00
Kubernetes Prow Robot
0e5d4a81f1
Merge pull request #115732 from jsafrane/revert-root-test
Revert #114605: its unit test requires root permission
2023-02-13 15:57:29 -08:00
Kubernetes Prow Robot
a0878eb715
Merge pull request #115709 from yoongon/feature/default-binder-testnode
Use predefined variable instead of duplicated string
2023-02-13 14:53:49 -08:00
Kubernetes Prow Robot
30f1567145
Merge pull request #115685 from skitt/rest-req-error
client-go: add an Error() function on Request
2023-02-13 14:53:41 -08:00
kidddddddddddddddddddddd
f5a69ffda9
feature(scheduler): won't run Score if PreScore returned a Skip status (#115652)
* allow preScore to return skip status to skip running the corresponding score extension

* add test case for all skipped

* add test case for select host

* update plugin status

* skip score when all plugins are skipped

* update
2023-02-13 14:53:29 -08:00
Will Daly
f5095bf34d kubectl debug: add netadmin profile
Add the netadmin profile from KEP 1441
https://github.com/kubernetes/enhancements/tree/master/keps/sig-cli/1441-kubectl-debug#debugging-profiles

Signed-off-by: Will Daly <widaly@microsoft.com>
2023-02-13 14:39:38 -08:00
Kubernetes Prow Robot
436ca94642
Merge pull request #115733 from skitt/remove-etcd-cp
Drop cp from the etcd images
2023-02-13 12:49:46 -08:00
Kubernetes Prow Robot
8b2545efa3
Merge pull request #115730 from ravisantoshgudimetla/remove-cgo
Remove cgo dependency
2023-02-13 12:49:38 -08:00
Kubernetes Prow Robot
49babf218a
Merge pull request #115464 from sunnylovestiramisu/fixCSIMigrationBug
Remove check for CSI driver running on node for CSI migration attach operations
2023-02-13 12:49:30 -08:00
Stephen Heywood
4d2611cf58 Update ineligible endpoints yaml
Adding the following endpoints
- connectCoreV1GetNamespacedPodPortforward
- connectCoreV1GetNamespacedPodAttach
- connectCoreV1PostNamespacedPodAttach
2023-02-14 09:00:44 +13:00
Odin Ugedal
27f4bcae5c client-go/cache: update Replace comment to be more clear
Since the behavior is now changed, and the old behavior leaked objects,
this adds a new comment about how Replace works.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>
2023-02-13 19:48:39 +00:00
Kubernetes Prow Robot
281acc6a6b
Merge pull request #115722 from ardaguclu/restclientgetter-debug
kubectl debug: Use restClientGetter instead cmd.Factory
2023-02-13 11:45:41 -08:00
Kubernetes Prow Robot
b8b18ecd85
Merge pull request #114051 from chrishenzie/rwop-preemption
[scheduler] Support preemption of pods using ReadWriteOncePod PVCs
2023-02-13 11:45:30 -08:00
Lars Ekman
50cfd6ca80 Add uablrek in pkg/util/ipvs/OWNERS 2023-02-13 19:11:21 +01:00
Jan Safranek
673ea6af78 Revert "add unit test for check unmounted behavior of Unmount"
This reverts commit bf77290bbf.

Because the unit tests requires to run as root.
2023-02-13 18:50:29 +01:00
Lucas Severo Alves
6b34fafdaf
Add ctx logging involved in KS startup (#115588)
* ctx logging involved in startup

as per https://github.com/kubernetes/kubernetes/pull/111155#pullrequestreview-1283257121

* use klog.Background().Error in flag handling

* revert scheduler_perf changes

* refence issue in code comment

* enable ctx logcheck for cmd/kube-scheduler
2023-02-13 09:19:29 -08:00
Stephen Kitt
b62165f445
Drop cp from the etcd images
This was used by migrate-if-needed.sh, but that has been replaced by
the migrate Go program which doesn't need external cp.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-02-13 18:06:59 +01:00
Jan Safranek
e7bd00b0b8 Revert "check umount result"
This reverts commit 368fd9d01e.
2023-02-13 17:52:26 +01:00
ravisantoshgudimetla
d65262d1f9 Remove cgo dependency 2023-02-13 11:16:39 -05:00
Odin Ugedal
7bcc3e00fc client-go/cache: rewrite Replace to check queue first
This is useful to both reduce the code complexity, and to ensure clients
get the "newest" version of an object known when its deleted. This is
all best-effort, but for clients it makes more sense giving them the
newest object they observed rather than an old one.

This is especially useful when an object is recreated. eg.

Object A with key K is in the KnownObjects store;
- DELETE delta for A is queued with key K
- CREATE delta for B is queued with key K
- Replace without any object with key K in it.

In this situation its better to create a DELETE delta with
DeletedFinalStateUnknown with B (with this patch), than it is to give
the client an DeletedFinalStateUnknown with A (without this patch).

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>
2023-02-13 14:59:56 +00:00
Odin Ugedal
cd3e98b65c client-go/cache: merge ReplaceMakesDeletionsForObjectsInQueue tests
Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>
2023-02-13 14:59:44 +00:00
Odin Ugedal
0bf0546d9f client-go/cache: fix missing delete event on replace without knownObjects
This fixes an issue where a relist could result in a DELETED delta
with an object wrapped in a DeletedFinalStateUnknown object; and then on
the next relist, it would wrap that object inside another
DeletedFinalStateUnknown, leaving the user with a "double" layer
of DeletedFinalStateUnknown's.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>
2023-02-13 14:59:33 +00:00
Kubernetes Prow Robot
8d25cc3193
Merge pull request #115723 from aojea/revert_latency
Revert "use kube-proxy defaults values for CI"
2023-02-13 06:49:38 -08:00
Kubernetes Prow Robot
79886690d4
Merge pull request #114920 from astefanutti/pr-codegen-144
fix: applyconfiguration-gen fails for types with non-builtin map fields
2023-02-13 06:49:30 -08:00
Odin Ugedal
25d77218ac client-go/cache: fix missing delete event on replace
This fixes a race condition when a "short lived" object
is created and the create event is still present on the queue
when a relist replaces the state. Previously that would lead in the
object being leaked.

The way this could happen is roughly;

1. new Object is added O, agent gets CREATED event for it
2. watch is terminated, and the agent runs a new list, L
3. CREATE event for O is still on the queue to be processed.
4. informer replaces the old data in store with L, and O is not in L
  - Since O is not in the store, and not in the list L, no DELETED event
    is queued
5. CREATE event for O is still on the queue to be processed.
6. CREATE event for O is processed
7. O is <leaked>; its present in the cache but not in k8s.

With this patch, on step 4. above it would create a DELETED event
ensuring that the object will be removed.

Signed-off-by: Odin Ugedal <ougedal@palantir.com>
Signed-off-by: Odin Ugedal <odin@uged.al>
2023-02-13 14:41:08 +00:00
Stephen Kitt
f69c1c4746
client-go: add an Error() function on Request
Requests can accumulate errors with no obvious indication, e.g. if
their primary purpose is to construct a URL: URL() itself doesn't
return an error if r.err is non-nil.

Instead of changing URL() to return an error, which has quite a large
impact, add an Error() function and indicate on URL() that it should
be checked.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-02-13 15:12:43 +01:00
Kubernetes Prow Robot
bf79066749
Merge pull request #115714 from aramase/aramase/f/kubernetes#115595
[KMSv2] Add kind cluster and encryption config for e2e
2023-02-13 05:43:42 -08:00
Kubernetes Prow Robot
4933005b38
Merge pull request #115697 from aojea/lbds
don't run loadbalancer tests on large environments
2023-02-13 05:43:30 -08:00
Antonio Ojea
07fc074a67 Revert "use kube-proxy defaults values for CI"
This reverts commit bafeacd14d.
2023-02-13 11:41:34 +00:00
Kubernetes Prow Robot
8ee0d3b6e8
Merge pull request #115584 from pbeschetnov/master
[HPA e2e] Calculate more precise consumed CPU usage for N replicas
2023-02-13 03:27:29 -08:00
Arda Güçlü
f5b0d728c5 kubectl debug: Use restClientGetter instead cmd.Factory
As the move towards using `restClientGetter` interface instead
gigantic `cmd.Factory`, this PR does that change.
2023-02-13 13:17:36 +03:00
Arda Güçlü
d66b339868 kubectl debug: Initialize pod client and builder in complete
This PR initializes podclient and builder in complete function
instead run function.
2023-02-13 13:17:31 +03:00
Arda Güçlü
3ffdee7d2b kubectl debug: Standartize add flag function
This PR standartize add flag function interface to align with
other kubectl commands.
2023-02-13 12:36:18 +03:00
Anish Ramasekar
4e6d5dddfb
[KMSv2] Add kind cluster and encryption config for e2e
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2023-02-13 06:42:54 +00:00
SataQiu
b9e5f5ad2f using const systemNodeRoleName instead of string system:node 2023-02-13 14:22:28 +08:00
Kubernetes Prow Robot
cfa295f569
Merge pull request #115594 from wking/included-failed-to-evict-pod-namespace
kubectl/pkg/drain: Include namespace in evictPods return error
2023-02-12 20:27:28 -08:00
Kubernetes Prow Robot
e818649c10
Merge pull request #115690 from tzneal/fix-buildx-check
fix docker buildx check
2023-02-12 14:27:30 -08:00
Patrick Ohly
3e760310b2 e2e: revise import restrictions
- test/e2e/framework/*.go should have very minimal dependencies.
  We can enforce that via import-boss.

- What each test/e2e/framework/* sub-package uses is less relevant,
  although ideally it also should be as minimal as possible in each case.

Enforcing this via import-boss ensures that new dependencies get flagged as
problem and thus will get additional scrutiny. It might be okay to add them,
but it needs to be considered.
2023-02-12 14:56:45 +01:00
Yoon
a3405f35b4 Use predefined variable instead of duplicated string 2023-02-12 20:50:39 +09:00
Antonio Ojea
244d7449ce don't run loadbalancer tests on large environments
Change-Id: Id987e9469e563c0837c6437a44a65889cec2e202
2023-02-11 10:28:25 +00:00
Son Dinh
4f75949bcb Ipvs: Add a new FlagSourceHash to "mh" distribution method.
With the flag, ipvs uses both source IP and source port (instead of
only source IP) to distribute new connections evently to endpoints
that avoids sending all connections from the same client (i.e. same
source IP) to one single endpoint.

User can explicitly set sessionAffinity in service spec to keep all
connections from a source IP to end up on the same endpoint if needed.

Change-Id: I42f950c0840ac06a4ee68a7bbdeab0fc5505c71f
2023-02-11 20:51:02 +11:00
Kubernetes Prow Robot
4303743736
Merge pull request #115692 from liggitt/go1.20
Disable unified build and static init optimization for tests
2023-02-10 18:11:30 -08:00
Kubernetes Prow Robot
d0db9a959b
Merge pull request #115677 from aramase/kmsv2-middleware
[KMSv2] implement local KEK service
2023-02-10 16:21:29 -08:00