Commit Graph

656 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
06d81cfc7a Merge pull request #130359 from my-git9/assertion1
fix wrong assertion on tests
2025-02-24 05:18:34 -08:00
xin.li
bc4ae15d77 fix wrong assertion on tests
Signed-off-by: xin.li <xin.li@daocloud.io>
2025-02-23 16:53:50 +08:00
Patrick Ohly
f9e7b15c00 ktesting: add Run
This is useful in Go unit tests because it directly replaces the corresponding
testing.T/B.Run.
2025-02-20 14:41:06 +01:00
Patrick Ohly
c2ad724e9a ktesting: add Parallel
It's useful for writing parallel unit tests.
2025-02-20 14:35:40 +01:00
cpanato
8ee64ba6b5 Bump images, dependencies and versions to go 1.23.6 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2025-02-10 14:04:37 -06:00
cpanato
0ca45bd4f8 Bump images, dependencies and versions to go 1.23.5 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2025-02-03 18:26:38 +01:00
Davanum Srinivas
c9e81cd84c Switch to gopkg.in/go-jose/go-jose.v2 @ v2.6.3
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-01-21 09:21:27 -05:00
bzsuni
df503e54c8 Update etcd from v3.5.16 to v3.5.17
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2025-01-02 10:20:42 +00:00
cpanato
2cb1cc9e3a Bump images, dependencies and versions to go 1.23.4 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-12-30 09:05:16 +01:00
cpanato
cb42224952 Bump images, dependencies and versions to go 1.23.3 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-11-19 09:57:41 +01:00
ndixita
99a6153a4f e2e tests
Signed-off-by: ndixita <ndixita@google.com>
2024-11-08 03:00:54 +00:00
Omer Aplatony
9d816f1587 Replace PollImmediate with PollUntilContextTimeout (#128147)
* Replace PollImmediate with PollUntilContextTimeout

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Add context to RetryErrorCondition function

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* lint: fix error comparison in scale package

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* Fix RetryErrorCondition function signature

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

* revert to if err statement

Signed-off-by: Omer Aplatony <omerap12@gmail.com>

---------

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2024-11-07 14:57:29 +00:00
Kubernetes Prow Robot
2002023a4e Merge pull request #127656 from jdtuhui/testifylint/formatter@test/utils
fix: enable formatter rule from testifylint in module test/utils
2024-10-23 07:26:52 +01:00
Kubernetes Prow Robot
fdc61b8fa2 Merge pull request #128116 from pohly/ktesting-context-timeout-warning
ktesting: improve context message
2024-10-23 00:12:53 +01:00
Patrick Ohly
4526b28606 ktesting: improve context message
This is not necessarily a problem, some code might use a timeout and expect it
to trigger. Therefore this should only be an info message, not a
warning. Long-term it might be useful to have an API where the caller decides
whether this gets logged.

The caller should use short messages and leave it to the user of those to
provide more context (no pun intended...). When logging, "canceling context" is
that context.

Before:

    scheduler_perf.go:1431: FATAL ERROR: op 7: delete scheduled pods: client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
    contexthelper.go:69:
        WARNING: the operation ran for the configured 2s

After:

    scheduler_perf.go:1431: FATAL ERROR: op 7: delete scheduled pods: client rate limiter Wait returned an error: rate: Wait(n=1) would exceed context deadline
    contexthelper.go:69:
        INFO: canceling context: the operation ran for the configured 2s
2024-10-16 10:46:24 +02:00
Haitao Chen
e9cbbc7886 bump golang to 1.23.2
from 1.23.0
2024-10-15 18:43:50 -07:00
Kubernetes Prow Robot
dd87bc0646 Merge pull request #127901 from skitt/k8s-sigs-yaml
Use sigs.k8s.io/yaml instead of gopkg.in/yaml
2024-10-09 19:38:29 +01:00
Stephen Kitt
f1fa4086b3 Use sigs.k8s.io/yaml instead of gopkg.in/yaml
Since we have a Kubernetes-specific fork of go-yaml, use that
consistently throughout the project. This doesn't eliminate the
dependencies on gopkg.in/yaml, which are still used indirectly; but it
ensures that the whole project benefits from fixes or changes to
sigs.k8s.io/yaml.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-10-07 15:32:00 +02:00
Marko Mudrinić
5572625d87 Revert "Merge pull request #127611 from haitch/haitao/k132-on-go123p1"
This reverts commit 37004f89b0, reversing
changes made to af879aebb1.
2024-10-04 19:11:07 +02:00
Maciej Skoczeń
2a08ce5c68 Add scheduler_perf test case for AssignedPodDelete event handling 2024-10-02 09:16:28 +00:00
Haitao Chen
2f906a0c02 bump golang to 1.23.1
revert rest of the changes other than default-go-version
2024-09-28 21:41:03 -07:00
Kubernetes Prow Robot
0c713c7bd6 Merge pull request #127285 from bzsuni/bz/etcd/update/v3.5.16
Update etcd from v3.5.15 to v3.5.16
2024-09-28 15:16:02 +01:00
tuhui1
c5e951946e fix: enable formatter rule from testifylint in module test/utils 2024-09-26 18:00:12 +08:00
Abhishek Kr Srivastav
95860cff1c Fix Go vet errors for master golang
Co-authored-by: Rajalakshmi-Girish <rajalakshmi.girish1@ibm.com>
Co-authored-by: Abhishek Kr Srivastav <Abhishek.kr.srivastav@ibm.com>
2024-09-20 12:36:38 +05:30
bzsuni
5b6ef4302e Update etcd from v3.5.15 to v3.5.16
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-09-11 10:51:34 +08:00
Kubernetes Prow Robot
cd30cf1867 Merge pull request #127141 from aojea/e2e_images_cleanup
remove unused images cuda-vector-add
2024-09-09 09:18:28 +01:00
Antonio Ojea
9ca4f946f3 remove unused images cuda-vector-add 2024-09-05 10:22:06 +00:00
Lan Liang
10a39e2c22 Bump version of agnhost to 2.53 used in e2e tests.
Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-09-05 04:59:38 +00:00
cpanato
b0c17b124f Bump images, dependencies and versions to go 1.23.0
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-09-02 10:42:04 -06:00
Patrick Ohly
5447d28c0d ktesting: log warning on timeout
How exactly a test reacts when its context times out is unclear. In the case of
scheduler_perf, the apiserver started to shut down and the test failure then
was about not being able to reach the apiserver, which was a bit confusing.

To make it more obvious why the shutdown starts, a WARNING message gets added
to the test output by ktesting before cancellation and thus before any other
output related to that cancellation.
2024-08-23 14:31:17 +02:00
Stephen Kitt
f4ddb44c36 Handle all mock header generation with mockery
mockery is set up to generate headers in all the mocks it produces, so
the separate header generation in update-mocks.sh is no longer useful
(and leads to duplicate headers in three cases). This removes the
relevant parts of the shell script.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-08-05 11:19:37 +02:00
ArkaSaha30
aa28bd6158 Revert distroless-iptables from v0.6.1 to v0.5.6
This commit will revert the distroless-iptables version from v0.6.1(built on go1.23rc2) to v0.5.6(built on go1.22.5).

Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
2024-07-29 13:55:37 +05:30
bzsuni
4ad2cd9299 Update etcd from v3.5.14 to v3.5.15
Signed-off-by: bzsuni <bingzhe.sun@daocloud.io>
2024-07-25 10:48:34 +08:00
Kubernetes Prow Robot
67c7e77044 Merge pull request #126047 from cpanato/upgrade-go-123
[go] Bump images, dependencies and versions to go 1.23rc2
2024-07-23 11:02:29 -07:00
cpanato
9d5a7ff859 Bump images, dependencies and versions to go 1.23rc2
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-19 11:33:28 +02:00
cpanato
5c269fecf8 Bump images, dependencies and versions to go 1.23rc1
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-19 11:33:24 +02:00
Monis Khan
6a6771b514 svm: set UID and RV on SSA patch to cause conflict on logical create
When a resource gets deleted during migration, the SVM SSA patch
calls are interpreted as a logical create request.  Since the object
from storage is nil, the merged result is just a type meta object,
which lacks a name in the body.  This fails when the API server
checks that the name from the request URL and the body are the same.
Note that a create request is something that SVM controller should
never do.

Once the UID is set on the patch, the API server will fail the
request at a slightly earlier point with an "uid mismatch" conflict
error, which the SVM controller can handle gracefully.

Setting UID by itself is not sufficient.  When a resource gets
deleted and recreated, if RV is not set but UID is set, we would get
an immutable field validation error for attempting to update the
UID.  To address this, we set the resource version on the SSA patch
as well.  This will cause that update request to also fail with a
conflict error.

Added the create verb on all resources for SVM controller RBAC as
otherwise the API server will reject the request before it fails
with a conflict error.

The change addresses a host of other issues with the SVM controller:

1. Include failure message in SVM resource
2. Do not block forever on unsynced GC monitor
3. Do not immediately fail on GC monitor being missing, allow for
   a grace period since discovery may be out of sync
4. Set higher QPS and burst to handle large migrations

Test changes:

1. Clean up CRD webhook convertor logs
2. Allow SVM tests to be run multiple times to make finding flakes easier
3. Create and delete CRs during CRD test to force out any flakes
4. Add a stress test with multiple parallel migrations
5. Enable RBAC on KAS
6. Run KCM directly to exercise wiring and RBAC
7. Better logs during CRD migration
8. Scan audit logs to confirm SVM controller never creates

Signed-off-by: Monis Khan <mok@microsoft.com>
2024-07-18 17:19:11 -04:00
Maciej Szulik
ce01dfc492 Cleanup unused test functions - cont-ed
Following up the work started in 0c0bd6d this is further cleaning up the
test/utils directory getting rid of unused functions.
2024-07-17 16:22:11 +02:00
cpanato
0e9308f3bc Bump images, dependencies and versions to go 1.22.5 and distroless iptables
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-07-04 16:34:18 +02:00
Benjamin Elder
df83363e87 remove unused prometheus exporter images from e2e image list 2024-07-03 15:08:14 -07:00
Matthieu MOREL
7bccbaf996 fix: enable and fixes rules from testifylint on test package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-06-30 05:44:47 +00:00
Kubernetes Prow Robot
1d51766c7a Merge pull request #125698 from pohly/dra-log-output
DRA: log output
2024-06-26 12:01:03 -07:00
Kubernetes Prow Robot
084d6c4968 Merge pull request #125699 from pohly/scheduler-framework-logging
scheduler: fix klog.KObjSlice when applied to []*NodeInfo
2024-06-26 01:50:23 -07:00
Patrick Ohly
fc55fecd45 ktesting: support capturing log output
This is a feature of the underlying k8s.io/klog/v2/ktesting which is
useful also when using the Kubernetes ktesting.
2024-06-26 08:11:31 +02:00
Kubernetes Prow Robot
8c478a06d8 Merge pull request #124595 from pohly/dra-scheduler-assume-cache-eventhandlers
DRA: scheduler event handlers via assume cache
2024-06-25 11:56:28 -07:00
Patrick Ohly
900457c09b ktesting: improve per-test log output
format.Object adds some white space in front of the value and a type identifier
in angle brackets. Both is distracting when printing simple values and can be
avoided by picking fmt.Sprintf for those types, plus trimming the result of
format.Object.

Before:

    allocator.go:483: I0625 15:35:31.946980] Allocating one device currentClaim=    <int>: 0 totalClaims=    <int>: 1 currentRequest=    <int>: 0 totalRequestsPerClaim=    <int>: 1 currentDevice=    <int>: 0 devicesPerRequest=    <int>: 1 allDevices=    <bool>: false adminAccess=    <bool>: false

After:

    allocator.go:483: I0625 15:35:04.371441] Allocating one device currentClaim=0 totalClaims=1 currentRequest=0 totalRequestsPerClaim=1 currentDevice=0 devicesPerRequest=1 allDevices=false adminAccess=false
2024-06-25 16:00:38 +02:00
Patrick Ohly
171620765e ktesting: add Step
Step simplifies using WithStep because it creates a local scope where the same
tCtx variable is the one with the step name.
2024-06-25 14:00:22 +02:00
Stephen Kitt
3f36c83c68 Switch to stretchr/testify / mockery for mocks
testify is used throughout the codebase; this switches mocks from
gomock to testify with the help of mockery for code generation.

Handlers and mocks in test/utils/oidc are moved to a new package:
mockery operates package by package, and requires packages to build
correctly; test/utils/oidc/testserver.go relies on the mocks and fails
to build when they are removed. Moving the interface and mocks to a
different package allows mockery to process that package without
having to build testserver.go.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2024-06-20 19:42:53 +02:00
Patrick Ohly
d88a153086 scheduler_perf: add DRA structured parameters test with shared claims
Several pods sharing the same claim is not common, but can be useful and thus
should get tested.

Before, createPods and createAny operations were not able to do this because
each generated object was the same. What we need are different, predictable
names of the claims (from createAny) and different references to those in the
pods (from createPods). Now text/template processing with the index number of
the pod respectively claim as input is used to inject these varying fields. A
"div" function is needed to use the same claim in several different pods.

While at it, some existing test cases get cleaned up a bit (removal of
incorrect comments, adding comments for testing with queuing hints).
2024-06-17 10:13:22 +02:00
cpanato
a3b193c6e9 [go] Bump images, dependencies and versions to go 1.22.4 and distroless iptables/setcap/debian-base
Signed-off-by: cpanato <ctadeu@gmail.com>
2024-06-06 18:13:15 +02:00