Commit Graph

125829 Commits

Author SHA1 Message Date
Patrick Ohly
d53cb79cec DRA cel: enforce runtime limit by default again
As pointed out during code review, the CEL cost estimates are not considered
perfectly reliable. Therefore it is better to also do runtime checks.

Some downstream users might decide to allow CEL expressions to run
longer. Therefore the cost limit is now part of an Options struct.
kube-scheduler uses the default cost limit defined in the resource.k8s.io API,
which is the same cost limit that also the apiserver uses during validation.
2024-10-23 21:24:45 +02:00
Patrick Ohly
021c9fb92f DRA CEL: add benchmark
Expression evaluation in all scenarios gets benchmarked where compilation
works. A pending optimization in another PR caches compiled expressions, so the
time for compilation will become less important. What matters is the actual
evaluation.
2024-10-23 21:24:45 +02:00
Patrick Ohly
425f694fe6 DRA CEL: log actual cost
This may be useful for validating the cost estimate.
2024-10-23 21:24:45 +02:00
Patrick Ohly
7b0071d71b DRA CEL: disable runtime cost check
In DRA, the cost check is done only at validation time.  At runtime, any
expression that passed validation gets executed without interrupting it. The
advantage is that it becomes easier to change the limit because stored
expression do not suddenly fail after an up- or downgrade. The limit could
even become a configuration parameter of the apiserver because that is the only
place where the limit gets checked
2024-10-23 21:24:45 +02:00
Patrick Ohly
39f2592863 DRA CEL: avoid redundant cel.CostTracking
It's already called by the base environment.
2024-10-23 21:24:45 +02:00
Patrick Ohly
5e514f5fcb DRA CEL: fix error checking in unit test
Not getting an expected error wasn't checked.
2024-10-23 21:24:45 +02:00
Patrick Ohly
7995b6f182 DRA CEL: add test case for runtime cost limit check
At the moment, the cost also gets checked at runtime. This test case
ensures that this check is really active.
2024-10-23 21:24:45 +02:00
Patrick Ohly
f548fc2264 DRA API: implement CEL cost limit
The main purpose is to protect against denial-of-service attacks.  Scheduling
time depends a lot on unpredictable factors and expected scheduling time also
varies, so no attempt is made to limit the overall time spent on evaluating CEL
expressions per claim.
2024-10-23 21:24:45 +02:00
cici37
ff9ef07370 Apply strictCost for DRA 2024-10-15 20:23:59 +02:00
Kubernetes Prow Robot
99cc395e2b
Merge pull request #128081 from soltysh/strict_spacing
Fix spacing in --validate flag description
2024-10-15 12:24:28 +01:00
Kubernetes Prow Robot
1cd8074b83
Merge pull request #128079 from pohly/e2e-daemonset-check-daemon-status-polling
e2e daemon set: better polling in CheckDaemonStatus
2024-10-15 12:24:21 +01:00
Kubernetes Prow Robot
d32e9b0b69
Merge pull request #127982 from tkashem/refactor-store-decoder
KEP-3926: refactor: extract etcd3 store decode functions into an interface
2024-10-15 10:28:22 +01:00
Maciej Szulik
7b0660ec9f
Fix spacing in --validate flag description 2024-10-15 11:16:33 +02:00
Kubernetes Prow Robot
7c53005b6c
Merge pull request #128066 from bart0sh/PR160-e2e_nod-fix-mirror-pod-test
e2e_node: fix mirror pod test
2024-10-15 09:24:21 +01:00
Patrick Ohly
e43065d542 e2e daemon set: better polling in CheckDaemonStatus
As a quick fix for a flake, bceec5a3ff
introduced polling with wait.Poll in all callers of CheckDaemonStatus.

This commit reverts all callers to what they were before (CheckDaemonStatus +
ExpectNoError) and implements polling according to E2E best practices
(https://github.com/kubernetes/community/blob/master/contributors/devel/sig-testing/writing-good-e2e-tests.md#polling-and-timeouts):

- no logging while polling
- support for progress reporting while polling
- last but not least, produce an informative failure message in case of a
  timeout, including a dump of the daemon set as YAML
2024-10-15 10:12:28 +02:00
Kubernetes Prow Robot
55b83c92b3
Merge pull request #128062 from aramase/aramase/i/cred_provider_config_typos
credential provider config: detect typos
2024-10-15 02:04:35 +01:00
Kubernetes Prow Robot
510a7e7601
Merge pull request #128038 from seans3/resource-quota-config-validation
Enable strict validation for ResourceQuotaConfiguration
2024-10-15 02:04:27 +01:00
Kubernetes Prow Robot
8b7b768ff7
Merge pull request #128011 from seans3/egress-selector-configuration-strict
EgressSelectorConfiguration now uses strict validation
2024-10-15 02:04:20 +01:00
Kubernetes Prow Robot
023cd33d23
Merge pull request #128009 from seans3/leader-migration-config-strict-validate
LeaderMigrationConfig now uses strict validation kube-controller-manager
2024-10-15 01:00:20 +01:00
Ed Bartosh
876819b8b6 e2e_node: fix mirror pod test
Modified stopNfsServer function to wait until nfs rpc is unregistered.
This should fix failing pull-kubernetes-node-arm64-ubuntu-serial-gce
job.
2024-10-15 02:05:26 +03:00
Kubernetes Prow Robot
d1e03f3a77
Merge pull request #127195 from yaojunyu/fix-pod-alway-restart-open-envetedpleg
EventedPLEG: Set Timestamp in PodStatus for Generic PLEG more accurate
2024-10-14 23:36:20 +01:00
Kubernetes Prow Robot
429edc5f25
Merge pull request #128060 from antoninbas/fix-typos-in-pkg/proxy/ipvs/ipset/ipset_test.go
Fix typos in pkg/proxy/ipvs/ipset/ipset_test.go
2024-10-14 22:02:21 +01:00
Kubernetes Prow Robot
9f09c55818
Merge pull request #128045 from princepereira/ppereira-hnslib-import
Replacing hcsshim library with new hnslib library.
2024-10-14 20:58:21 +01:00
Anish Ramasekar
1882a4a9f0
credential provider config: detect typos
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2024-10-14 12:23:43 -07:00
Antonin Bas
0350e5ae69 Fix typos in pkg/proxy/ipvs/ipset/ipset_test.go
There were a couple of typos in test error logs

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
2024-10-14 11:06:36 -07:00
Prince Pereira
3448455083 Replacing hcsshim library with new hnslib library. 2024-10-14 10:44:30 -07:00
Kubernetes Prow Robot
78879fa3d0
Merge pull request #128054 from aojea/e2e_ds_flake
e2e flake CheckDaemonStatus assert on async value
2024-10-14 18:16:21 +01:00
Kubernetes Prow Robot
62c1aa0529
Merge pull request #127929 from pohly/prune-junit-xml-failure
prune-junit-xml: simplify failure message
2024-10-14 17:08:21 +01:00
Kubernetes Prow Robot
7f5510921d
Merge pull request #128052 from saschagrunert/imagefsinfo-timeout
CRI client: use default timeout for ImageFsInfo RPC
2024-10-14 15:16:28 +01:00
Kubernetes Prow Robot
9a0b07d38c
Merge pull request #128051 from googs1025/kubectl/fix/resourcebuilder
bug(kubectl): return resource builder error in scale cmd
2024-10-14 15:16:20 +01:00
Abu Kashem
1d1a656d8d
refactor: extract decode functions into an interface for etcd3 store 2024-10-14 10:04:03 -04:00
Antonio Ojea
bceec5a3ff e2e flake CheckDaemonStatus assert on async value
The util for checking on daemonstatus was checking once if the Status of
the daemonset was reporting that all the desired Pods are scheduled and
ready.

However, the pattern used in the e2e test for this function was not
taking into consideration that the controller needs to propagate the Pod
status to the DeamonSet status, and was asserting on the condition only
once after waiting for all the Pods to be ready.

In order to avoid more churn code, change the CheckDaemonStatus
signature to the wait.Condition type and use it in a async poll loop on
the tests.
2024-10-14 13:30:03 +00:00
Kubernetes Prow Robot
de8f6b0db7
Merge pull request #128037 from dshebib/e2eNode_containerLifecycleContext
[e2e_node] Use shared context in regular container tests
2024-10-14 13:10:28 +01:00
Kubernetes Prow Robot
a454563a8d
Merge pull request #127812 from p0lyn0mial/upstream-decode-list-blueprint
client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests
2024-10-14 13:10:21 +01:00
Sascha Grunert
e055a1f89a
CRI client: use default timeout for ImageFsInfo RPC
The RPC call usually does not take much time for containerd or CRI-O. We
now assume the default timeout is fine and therefore resolve the `TODO`.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-10-14 13:49:03 +02:00
Kubernetes Prow Robot
faf89fe5e9
Merge pull request #128000 from klueska/fix-resourceslice-filter
DRA: Update resourceslice controller filtering logic
2024-10-14 12:06:20 +01:00
googs1025
8d08480929 bug(kubectl): return resource builder error in scale cmd 2024-10-14 18:52:56 +08:00
Kubernetes Prow Robot
d003e4cd9f
Merge pull request #127923 from unvavo/add-test-tainttoleration-for-queueinghint
add integration test for tainttoleration in requeueing scenarios
2024-10-14 10:20:28 +01:00
Kubernetes Prow Robot
769695a218
Merge pull request #126776 from neolit123/1.31-improve-dry-run-logic
kubeadm: refactor the dry-run logic
2024-10-14 10:20:21 +01:00
Kubernetes Prow Robot
c5abe615eb
Merge pull request #128021 from toVersus/fix/flaky-restart-check
[Sidecar Containers] Check for restarts without being affected by container startup order
2024-10-14 07:56:21 +01:00
Lukasz Szaszkiewicz
7be192ae0b client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests 2024-10-14 08:48:32 +02:00
Kubernetes Prow Robot
5b1a4caeda
Merge pull request #127881 from omerap12/drain-package-PollUntilContextTimeout
Update waitForDelete to use PollUntilContextTimeout
2024-10-14 06:18:20 +01:00
Sean Sullivan
a95c0c5499 Enable strict validation for ResourceQuotaConfiguration 2024-10-13 17:50:18 -07:00
Sean Sullivan
32b2eea50d EgressSelectorConfiguration now uses strict validation 2024-10-13 16:09:35 -07:00
Kubernetes Prow Robot
4dc7a48ac6
Merge pull request #128035 from alexanderstephan/export-reflector
Make getter names for reflector fields idiomatic
2024-10-13 23:04:20 +01:00
Alexander Stephan
fdabcb5141 Make getter names for reflector fields idiomatic 2024-10-13 20:53:25 +00:00
Patrick Ohly
fba2bcf2d2 prune-junit-xml: simplify failure message
In Go unit tests, the entire test output becomes the failure message because
`go test` doesn't track why a test fails. This can make the failure message
pretty large, in particular in integration tests.

We cannot identify the real failure either because Kubernetes has no convention
for how to format test failures. What we can do is recognize log output added
by klog.

prune-junit-xml now moves the full text to to the test output and only keep
those lines in the failure which are not from klog.

The klog output parsing might eventually get moved to
k8s.io/logtools/logparse. For now it is developed as a sub-package of
prune-junit-xml.
2024-10-13 09:37:50 +02:00
Kubernetes Prow Robot
468676cb2f
Merge pull request #127677 from jdtuhui/testifylint/formatter@security
fix: unnecessary fmt.Sprintf in assertions
2024-10-13 07:44:19 +01:00
Kubernetes Prow Robot
17d7f1b564
Merge pull request #128025 from bart0sh/PR159-Makefile-fix-escaping
Makefile: escape $ to prevent confusing output
2024-10-13 03:28:19 +01:00
Daniel Shebib
1618dbe695 Add context to tests 2024-10-12 21:23:29 -05:00