Commit Graph

120594 Commits

Author SHA1 Message Date
Mark Rossetti
5ba3883be0
Adding unit test for makeWinContainerStats
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2024-02-12 09:56:58 -08:00
Mark Rossetti
5691a7899e
Fixing bug with windows criStatsProvider sometimes not reporting AvailableBytes correctly
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2024-01-18 10:13:49 -08:00
Kubernetes Prow Robot
3bbf0cc47f
Merge pull request #122837 from tnqn/remove-permission
Remove unneeded permissions of node-controller role
2024-01-18 19:03:20 +01:00
Kubernetes Prow Robot
afb1523bf4
Merge pull request #122833 from kannon92/add-density-test-flake
mark density tests as flaky
2024-01-18 19:03:11 +01:00
Kubernetes Prow Robot
8835dabc3b
Merge pull request #122841 from neolit123/1.30-v1beta4-timeouts
kubeadm: special case context errors in GetConfigMapWithShortRetry
2024-01-18 15:57:24 +01:00
Kevin Hannon
8a89a1f5a5 mark density tests as flaky 2024-01-18 09:50:39 -05:00
Lubomir I. Ivanov
26a79e4c0b kubeadm: special case context errors in GetConfigMapWithShortRetry
If some code is about to go over the context deadline,
"x/time/rate/rate.go" would return and untyped error with the string
"would exceed context deadline". If some code already exceeded
the deadline the error would be of type DeadlineExceeded.
Ignore such context errors and only store API and connectivity errors.
2024-01-18 15:35:25 +02:00
Kubernetes Prow Robot
b1ab18ade2
Merge pull request #122608 from p0lyn0mial/upstream-kcm-enable-watchlistclient-fg
kube-controller-manager: unit tests WatchListClient feature for client-go
2024-01-18 12:05:21 +01:00
Kubernetes Prow Robot
1e136ef8a0
Merge pull request #122523 from yasindce1998/secret-fix
fix: create tls secret cert to crt for --cert flag
2024-01-18 09:52:36 +01:00
Lukasz Szaszkiewicz
8668c7f718 kube-controller-manager/options: unit test WatchListClient feature gate for command line options 2024-01-18 09:22:14 +01:00
Quan Tian
3a6060745c Remove unneeded permissions of node-controller role
Signed-off-by: Quan Tian <qtian@vmware.com>
2024-01-18 15:58:28 +08:00
Vandit Singh
83ff8a2f49
Negative index regression test for json-patch (#122625)
* add testcase with negative index

* exercise successful negative index patching

* use different values for testing

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>

---------

Co-authored-by: Chris Bandy <bandy.chris@gmail.com>
2024-01-18 08:44:19 +01:00
Kubernetes Prow Robot
a02a00ecd7
Merge pull request #122142 from pohly/client-go-events-adapter-context
client-go events: also support context for NewEventBroadcasterAdapter
2024-01-18 08:44:12 +01:00
Kubernetes Prow Robot
5ad2c12a69
Merge pull request #122701 from carlory/fix-quota
Fix resource deletion failure caused by quota calculation error when InPlacePodVerticalScaling is turned on
2024-01-18 06:38:21 +01:00
Kubernetes Prow Robot
2624e93d55
Merge pull request #122823 from pohly/e2e-deadcode-removal
e2e: remove dead code
2024-01-17 22:42:51 +01:00
Kubernetes Release Robot
f40ff3d9ff CHANGELOG: Update directory for v1.26.13 release 2024-01-17 19:42:12 +00:00
Kubernetes Release Robot
14294ce870 CHANGELOG: Update directory for v1.28.6 release 2024-01-17 19:40:03 +00:00
Kubernetes Release Robot
4a9906fd34 CHANGELOG: Update directory for v1.27.10 release 2024-01-17 19:39:57 +00:00
Kubernetes Release Robot
4f8aa21da8 CHANGELOG: Update directory for v1.29.1 release 2024-01-17 19:37:24 +00:00
Kubernetes Prow Robot
6180759dba
Merge pull request #122738 from benluddy/client-go-feature-gate-adapter
Inject feature gate instance into client-go for kube components.
2024-01-17 18:33:56 +01:00
Kubernetes Prow Robot
b26f6dfce9
Merge pull request #121783 from atwamahmoud/ignore-scheduler-tests
Add tests for ignoring scheduler processing
2024-01-17 18:33:47 +01:00
Patrick Ohly
f8e25eff92 client-go events: also support context for NewEventBroadcasterAdapter
27a68aee3a introduced context support. In order to use that
also with NewEventBroadcasterAdapter, a variant of the call is needed to allow
the caller to specify the context.

The `logcheck:context` comment ensures that code which is meant to be
contextual uses the new call.
2024-01-17 18:06:29 +01:00
Kubernetes Prow Robot
05780d58bf
Merge pull request #122788 from my-git9/renewal-manager
kubeadm: increase ut coverage for certs/renewal/manager
2024-01-17 17:20:03 +01:00
xin.li
6451fb0fe2 kubeadm: increase ut coverage for certs/renewal/manager
Signed-off-by: xin.li <xin.li@daocloud.io>
2024-01-17 21:51:24 +08:00
Patrick Ohly
3aa366a3eb e2e: remove dead code
The dead code was found with:

    deadcode -test -filter=k8s.io/kubernetes/test/e2e/framework/... ./test/e2e ./test/e2e_node ./test/e2e_node ./test/e2e_kubeadm

See https://go.dev/blog/deadcode for an introduction.

Only dead code which is clearly not needed anymore (glog logging),
questionable (skipping based on feature gates) or
redundant (WaitForPodSuccessInNamespaceSlow) gets removed for now. More
removals might make sense in the future.
2024-01-17 12:57:35 +01:00
Kubernetes Prow Robot
909faa3a9b
Merge pull request #116627 from claudiubelu/unittests-8
unittests: Fixes unit tests for Windows (part 8)
2024-01-17 05:43:54 +01:00
Kubernetes Prow Robot
a4a56701b5
Merge pull request #122811 from neolit123/1.30-v1beta4-timeouts
kubeadm: keep a function with short timeout in idempotency.go
2024-01-17 04:37:11 +01:00
Kubernetes Prow Robot
d399535b01
Merge pull request #122762 from yxxhero/check-initData-and-joinData-safely
Fix type assertion error in init and join commands for kubeadm
2024-01-17 04:37:05 +01:00
carlory
041e97af1f fix evaluate resource quota if a resource is updated when the InPlacePodVerticalScaling feature-gate is on 2024-01-17 11:02:54 +08:00
Kubernetes Prow Robot
c1fff408c0
Merge pull request #120254 from ionutbalutoiu/windows-tests/conn-check-retries
windows-tests: Add retries to Windows `assertConsistentConnectivity` …
2024-01-17 02:21:38 +01:00
yxxhero
d21fc96db3 Fix type assertion error in init and join commands for kubeadm
Signed-off-by: yxxhero <aiopsclub@163.com>
2024-01-17 07:50:29 +08:00
Kubernetes Prow Robot
f84b2f0254
Merge pull request #122729 from jparrill/HOSTEDCP-336
Kube codegen tool now ignore the vendor folder by default on code generation
2024-01-16 20:48:44 +01:00
Lukasz Szaszkiewicz
8a32f346a0
kube/features: improve unit testing known/registered features
Co-authored-by: Ben Luddy <bluddy@redhat.com>
2024-01-16 12:51:00 -05:00
Ben Luddy
995135973d
Inject feature gate instance into client-go for kube components.
In order to avoid a dependency cycle between component-base and client-go, client-go maintains
parallel definitions of component-base's feature types and constants. Passing kube's default feature
gate instance to client-go requires an adapter.
2024-01-16 12:51:00 -05:00
Lubomir I. Ivanov
54a6e6a772 kubeadm: keep a function with short timeout in idempotency.go
- Name the function GetConfigMapWithShortRetry to be
easier to understand that the function is with a very short timeout.
Add note that this function should be used in cases there is a
fallback to local config.
- Apply custom hardcoded interval of 50ms and timeout of 350ms to it.
Previously the fucntion used exp backoff with 5 steps up to ~340ms.
2024-01-16 17:53:21 +02:00
Mahmoud Atwa
ec89154276 Handles clean up errors 2024-01-16 11:53:55 +00:00
Kubernetes Prow Robot
9b5e2dc54d
Merge pull request #122231 from ardaguclu/get-cronjob-timezone
Add timezone column in cronjob get command
2024-01-16 12:53:18 +01:00
Mahmoud Atwa
80fbc4c319 Revert using ginkgo.DeferCleanup as it doesn't run in the correct order 2024-01-16 10:45:36 +00:00
Kubernetes Prow Robot
c75a146f23
Merge pull request #122772 from thockin/codegen_use_passed_flagset
code-gen: Use the passed FlagSet, not hardcoded
2024-01-16 09:49:33 +01:00
Kubernetes Prow Robot
72d30a588b
Merge pull request #122754 from KubeKyrie/fix/replace-expected-field
expected and actual field position adjustment
2024-01-16 06:42:03 +01:00
Kubernetes Prow Robot
ebb79e5cf9
Merge pull request #122768 from danwinship/conntrack-cleanup
conntrack cleanup cleanup
2024-01-16 01:15:29 +01:00
Kubernetes Prow Robot
8ba29970e6
Merge pull request #122529 from neolit123/1.30-v1beta4-timeouts
kubeadm: add a Timeouts struct to v1beta4
2024-01-15 19:33:58 +01:00
Dan Winship
fcb51554a1 Plumb the conntrack.Interface up to the proxiers
And use the fake interface in the unit tests, removing the dependency
on setting up FakeExec stuff when conntrack cleanup will be invoked.

Also, remove the isIPv6 argument to CleanStaleEntries, because it can
be inferred from the other args.
2024-01-15 13:09:05 -05:00
Dan Winship
cdf934d5bc Remove redundant iptables/nftables conntrack cleanup tests
The iptables and nftables proxy backends had 2 unit tests
(TestDeleteEndpointConnections and TestProxierDeleteNodePortStaleUDP)
that were effectively testing that:

  - If the proxy saw various Service/EndpointSlice events this would
    result in specific changes to the service/endpoints trackers, AND

  - If the service/endpoints trackers changed in those specific ways
    this would result in specific UpdateServiceMapResult and
    UpdateEndpointsMapResult values being generated, AND

  - If you passed those specific UpdateServiceMapResult and
    UpdateEndpointsMapResult values to conntrack.CleanStaleEntries it
    would make specific calls to the lower-level conntrack methods,
    AND

  - If you called the lower-level conntrack methods with those
    specific arguments, it would result in specific executions of the
    conntrack binary, mixed with a specific number of klog
    invocations.

This... is not a good unit test. We already test the change tracker
behavior in other unit tests, and we already tested the
Update{Service,Endpoints}MapResult behavior in the pkg/proxy unit
tests, and we already tested the conntrack exec behavior in
pkg/proxy/conntrack/conntrack_test.go, and we now test the
CleanStaleEntries behavior in pkg/proxy/conntrack/cleanup_test.go. So
there is no need to try to test the top-to-bottom behavior as a "unit
test".
2024-01-15 13:08:52 -05:00
Dan Winship
db12cbe2ae Add conntrack.Interface, test CleanStaleEntries
Add an interface between CleanStaleEntries and the lower-level
conntrack helpers (ClearEntriesForIP, etc), and a fake implementation
of that interface, so that we can explicitly test CleanStaleEntries's
logic.

Remove some comments from conntrack.go that were explaining the
functions' callers rather than explaining the functions themselves
(and which were redundant with other comments in the callers anyway).
2024-01-15 13:08:36 -05:00
Dan Winship
51063cb5c4 Clean up conntrack unit tests
Fix the test names to match the functions they are testing.

Abstract out the repetitive FakeExec handling.

Explicitly specify the "expectCommand" in each one, to make it clearer
that that's really the part that we're testing.

For everything except TestExec(), test each case with both a "success"
result and a "nothing to delete" result from the conntrack binary.
2024-01-15 13:07:08 -05:00
Kubernetes Prow Robot
789e029364
Merge pull request #122735 from avorima/fix-kubeadm-regression-2992
kubeadm: fix a regression in "kubeadm init" where --kubeconfig is ignored
2024-01-15 18:21:04 +01:00
Kubernetes Prow Robot
026a27e5eb
Merge pull request #122571 from p0lyn0mial/upstream-client-go-watch-list-fg
client-go/features: introduce WatchListClient feature gate
2024-01-15 18:20:55 +01:00
Kubernetes Prow Robot
29bf09136e
Merge pull request #122732 from ahutsunshine/typo
fix version typo of pod namespace indexer
2024-01-15 16:23:28 +01:00
Kubernetes Prow Robot
f38ff3feea
Merge pull request #121716 from kerthcet/cleanup/add-log
Add more logs to scheduler event handler
2024-01-15 16:23:19 +01:00