Commit Graph

22986 Commits

Author SHA1 Message Date
David Porter
826472c99d test: e2e node shutdown test logging improvements
Since the pod names are reused across the test, searching the logs is
currently difficult.

Use a uuid for each pod name to make grepping the logs easier. Also,
always include the pod name and pod namespace in any logs or error
messages to make debugging easier.

Signed-off-by: David Porter <david@porter.me>
2023-02-10 16:54:31 -08:00
Kubernetes Prow Robot
0424a530a4
Merge pull request #115678 from pohly/e2e-full-reports
e2e: revise complete report creation
2023-02-10 15:07:29 -08:00
Kubernetes Prow Robot
1749bb2991
Merge pull request #115579 from ardaguclu/fix-wait-sh-timeout
flaky test wait.sh: Add deployment assertion before running wait
2023-02-10 13:59:29 -08:00
Patrick Ohly
3e2b26ce52 e2e: revise complete report creation
The previous approach was based on the observation that some Prow jobs use the
--report-dir parameter instead of the E2E_REPORT_DIR env variable. Parsing the
command line was necessary to use the --json-report and --junit-report
parameters.

But that is complex and can be avoided by triggering the creation of complete
reports in the E2E test suite. The paths are hard-coded and relative to the
report directory to keep the code simple.

There was a report that k8s-triage started processing more data after
6db4b741dd was merged. It's unclear whether
that was because of the new <report-dir>/ginkgo_report.xml file. To avoid
this potential problem, the reports are now in a "ginkgo" sub-directory.

While at it, error checking gets enhanced:
- Create directories at the start of
  the suite and bail out early if that fails.
- *All* e2e suites using the framework do this, not just test/e2e.
- Added missing error checking of truncated JUnit report writing.
2023-02-10 10:20:20 +01:00
Arda Güçlü
e0fedec69d (kubectl debug): Support debugging via files
Currently `kubectl debug` only supports passing names in command line.
However, users might want to pass resources in files by passing `-f` flag like
in all other kubectl commands.

This PR adds this ability.
2023-02-10 10:21:30 +03:00
Kubernetes Prow Robot
b2f8c8f00d
Merge pull request #115635 from bobbypage/npd-time-fix
test: Simplify NPD start timestamp calculation
2023-02-09 18:37:31 -08:00
Kubernetes Prow Robot
0698d9eb82
Merge pull request #115649 from aramase/grpc-metrics
[KMSv2] Add metrics for grpc service
2023-02-09 15:50:45 -08:00
Kubernetes Prow Robot
6e2e61bb3c
Merge pull request #115657 from saschagrunert/inject-base64
Allow SSH e2e node base64 key injection
2023-02-09 14:45:06 -08:00
Kubernetes Prow Robot
95c65ca3a0
Merge pull request #115454 from dgrisonnet/promote-pod-resource-metrics
Promote pod resource metrics to stable
2023-02-09 12:36:16 -08:00
Damien Grisonnet
49da8a1d4a scheduler: promote pod resource metrics to stable
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
2023-02-09 20:30:45 +01:00
Anish Ramasekar
de3b2d525b
[KMSv2] Add metrics for grpc service
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2023-02-09 18:51:37 +00:00
Sascha Grunert
85106dc327
Allow SSH e2e node base64 key injection
With the change of the CRI-O jobs to use butane, we now have a
verification for base64 data urls in place. This means that the
following URL is invalid:

```
data:text/plain;base64,GCE_SSH_PUBLIC_KEY_FILE_CONTENT
```

This means we have to pass valid base64 to the URL. To fix that, we now
allow to inject SSH key values with both, the
`GCE_SSH_PUBLIC_KEY_FILE_CONTENT` field and its base64 encoded variant.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-02-09 16:17:11 +01:00
vaibhav2107
6ab8a8fbec Updated the change in registry 2023-02-09 09:37:44 +05:30
David Porter
7fe371a974 test: Simplify NPD start timestamp calculation
The NPD test checks when NPD started to determine if it is needed to
check the kubelet start event. The current logic requires parsing the
journalctl logs which is quite fragile and is broken now because of
systemd changing the expected log format.

Newer versions of systemd do not print "end at" or "logs begin at" and
instead may print "No entries", which will result in the test panicking.

```
$ journalctl -u foo.service
-- No entries --
```

For units started, it will not print "end at" or "logs begin at":

```
root@ubuntu-jammy:~# journalctl -u foo.service
Feb 08 22:02:19 ubuntu-jammy systemd[1]: Started /usr/bin/sleep 1s.
Feb 08 22:02:20 ubuntu-jammy systemd[1]: foo.service: Deactivated successfully.
```

To avoid relying on log parsing which is fragile, let's instead directly
ask systemd when the NPD service started and parse the resulting
timestamp.

Signed-off-by: David Porter <david@porter.me>
2023-02-08 13:58:45 -08:00
Kubernetes Prow Robot
468ce59183
Merge pull request #115557 from MikeSpreitzer/cleanup-path-hack
Simplify construction of /metrics request
2023-02-08 09:28:58 -08:00
Matthew Cary
69808b74ec Remove obsolete GKE local SSD test
Change-Id: I156bd03ac740c2ebe394081d3106851f7182269f
2023-02-07 17:33:32 -08:00
Riaan Kleinhans
999e9f14f7
remove conformance tested endpoints 2023-02-08 11:55:44 +13:00
Kubernetes Prow Robot
090025f5e6
Merge pull request #115548 from pohly/e2e-wait-for-pods-with-gomega
e2e: wait for pods with gomega, II
2023-02-07 07:01:21 -08:00
Kubernetes Prow Robot
22b88dea36
Merge pull request #115315 from enj/enj/i/kas_kubelet_conn_close
kubelet/client: collapse transport wiring onto standard approach
2023-02-07 07:01:14 -08:00
Kubernetes Prow Robot
4f321041bd
Merge pull request #115537 from MadhavJivrajani/bump-tools-deps-go120
*: Bump golangci-lint version and adapt to new linters
2023-02-07 05:53:12 -08:00
Pavel Beschetnov
456de495ef Calculate more precise usage for replicas 2023-02-07 12:41:36 +00:00
Arda Güçlü
60401d35d1 flaky test wait.sh: Add deployment assertion before running wait
There is a test in wait.sh integration suite which is checking the
given timeout value(passed by user) is equal to actual happened timeout value.

However, this test rarely gets `no matching resources found` error and
causes flakyiness. The reason is we are running wait command, immediately
after applying deployment. In reality, timeout test does not care about
deployment, since it is testing the timeout by passing invalid configurations.
But we need this deployment to not get `no matching resources found` error.

That's why, this PR adds deployment assertion before executing wait command.
2023-02-07 14:19:34 +03:00
Madhav Jivrajani
5e1f440d0a *: Fix linter warnings
Adapt to newly improved linters in golangci-lint v1.51.1

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
2023-02-07 13:01:41 +05:30
Kubernetes Prow Robot
e944fc28ca
Merge pull request #115443 from torredil/master
Add windows nodeSelector to e2e storage testing pods
2023-02-06 18:27:09 -08:00
Monis Khan
754cb3d601
kubelet/client: collapse transport wiring onto standard approach
Signed-off-by: Monis Khan <mok@microsoft.com>
2023-02-06 20:34:49 -05:00
Mike Spreitzer
e9973979d0 Simplify construction of /metrics request 2023-02-06 16:20:34 -05:00
torredil
25389ee0ee
Add nodeSelector to e2e storage testing pods
Signed-off-by: torredil <torredil@amazon.com>
2023-02-06 16:00:51 +00:00
Patrick Ohly
136f89dfc5 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-02-06 15:39:13 +01:00
Patrick Ohly
9878e735dd e2e pod: unit test for pod status + API error
This covers new behavior in gomega.
2023-02-06 15:39:13 +01:00
Patrick Ohly
1bd1167d56 e2e pod: remove dead code 2023-02-06 15:39:13 +01:00
Patrick Ohly
3bb735e6fa e2e pod: use gomega.Eventually in WaitForRestartablePods 2023-02-06 15:39:13 +01:00
Patrick Ohly
1e346c4e4a e2e pod: convert ProxyResponseChecker into matcher
Instead of pod responses being printed to the log each time polling fails, we
get a consolidated failure message with all unexpected pod responses if (and
only if) the check times out or a progress report gets produced.
2023-02-06 15:39:13 +01:00
Patrick Ohly
c3266cde77 e2e: consolidate pod response checking
This renames PodsResponding to WaitForPodsResponding for the sake of
consistency and adds a timeout parameter. That is necessary because some other
users of NewProxyResponseChecker used a much lower timeout (2min vs. 15min).

Besides simplifying some code, it also makes it easier to rewrite
ProxyResponseChecker because it only gets used in WaitForPodsResponding.
2023-02-06 15:39:13 +01:00
Patrick Ohly
89a5d6d8af e2e pod: use gomega.Eventually in WaitForPodNotFoundInNamespace 2023-02-06 15:39:13 +01:00
Patrick Ohly
9df3e2a47a e2e: replace WaitForPodToDisappear with WaitForPodNotFoundInNamespace
WaitForPodToDisappear was always called such that it listed all pods, which
made it less efficient than trying to get just the one pod it was checking for.

Being able to customize the poll interval in practice wasn't useful, therefore
it can be replaced with WaitForPodNotFoundInNamespace.
2023-02-06 15:39:12 +01:00
Patrick Ohly
45d4631069 e2e: consolidate checking a pod list
WaitForPods is now a generic function which lists pods and then checks the pods
that it found against some provided condition. A parameter determines how many
pods must be found resp. match the condition for the check to succeed.
2023-02-06 15:39:12 +01:00
Patrick Ohly
d8428c6fb1 e2e pod: use gomega.Eventually in WaitTimeoutForPodReadyInNamespace/WaitForPodCondition
These get converted together because they relied on FinalErr which now isn't
needed anymore.
2023-02-06 15:39:12 +01:00
Patrick Ohly
01a40d9d6b e2e framework: support getting list of objects
This is similar to the previous support for getting a single object.
2023-02-06 15:39:12 +01:00
Patrick Ohly
3dd185aa40 e2e pod: use gomega.Eventually in WaitForPodsRunningReady
The code becomes simpler (78 insertions, 91 deletions), easier to read (all
code entirely inside WaitForPodsRunningReady, no need to declare and later
overwrite variables) and possibly more correct (if all API calls failed,
the resulting error was ignored when allowedNotReadyPods > 0).
2023-02-06 15:39:12 +01:00
Patrick Ohly
afbb2c5323 e2e framework: turn function into gomega.Matcher
The intention is to use this inside a helper function where the
corresponding Expect call is known.
2023-02-06 15:39:12 +01:00
Patrick Ohly
4d63e7d4d6 e2e: remove unused label filter from WaitForPodsRunningReady
None of the users of the functions passed anything other than nil or an empty
map and the implementation ignore the parameter - it seems like a candidate for
simplification.
2023-02-06 15:39:12 +01:00
Patrick Ohly
8181f97ecc e2e framework: include additional stack backtrace in failures
When a Gomega failure is converted to an error, the stack at the time when the
failure occurs may be useful: error wrapping provides some bread crumbs that
can be followed to determine where the failure really occurred, but error
wrapping may be missing or ambiguous.

To provide the additional information, a FailureError now includes a full stack
backtrace. The backtrace intentionally makes no attempt to exclude framework
functions besides the gomega support itself because helpers like
e2e/framework/pod may be relevant.

That backtrace is not included in the failure message for the sake of
brevity. Instead, it gets logged as part of the test's output.
2023-02-06 15:39:12 +01:00
Patrick Ohly
005a9da0cc e2e framework: implement pod polling with gomega.Eventually
gomega.Eventually provides better progress reports: instead of filling up the
log with rather useless one-line messages that are not enough to to understand
the current state, it integrates with Gingko's progress reporting (SIGUSR1,
--poll-progress-after) and then dumps the same complete failure message as
after a timeout. That makes it possible to understand why progress isn't
getting made without having to wait for the timeout.

The other advantage is that the failure message for some unexpected pod state
becomes more readable: instead of encapsulating it as "observed object" inside
an error, it directly gets rendered by gomega.
2023-02-06 15:39:12 +01:00
Patrick Ohly
71dc81ec89 e2e framework: gomega assertions as errors
Calling gomega.Expect/Eventually/Consistently deep inside a helper call chain
has several challenges:
- the stack offset must be tracked correctly, otherwise the callstack
  for the failure starts at some helper code, which is often not informative
- augmenting the failure message with additional information from each
  caller implies that each caller must pass down a string and/or format
  string plus arguments

Both challenges can be solved by returning errors:
- the stacktrace is taken at that level where the error is
  treated as a failure instead of passing back an error, i.e.
  inside the It callback
- traditional error wrapping can add additional information, if
  desirable

What was missing was some easy way to generate an error via a gomega
assertion. The new infrastructure achieves that by mirroring the
Gomega/Assertion/AsyncAssertion interfaces with errors as return values instead
of calling a fail handler.

It is intentionally less flexible than the gomega APIs:
- A context must be passed to Eventually/Consistently as first
  parameter because that is needed for proper timeout handling.
- No additional text can be added to the failure through this
  API because error wrapping is meant to be used for this.
- No need to adjust the callstack offset because no backtrace
  is recorded when a failure occurs.

To avoid the useless "unexpected error" log message when passing back a gomega
failure, ExpectNoError gets extended to recognize such errors and then skips
the logging.
2023-02-06 15:39:12 +01:00
Patrick Ohly
d17ce64ac5 e2e storage: remove WaitForPodTerminatedInNamespace
Calling WaitForPodTerminatedInNamespace after testFlexVolume is useless because
the client pod that it waits for always gets deleted by testVolumeClient:

0fcc3dbd55/test/e2e/framework/volume/fixtures.go (L541-L546)

Worse, because WaitForPodTerminatedInNamespace treats "not found" as "must keep
polling", these two tests always kept waiting for 5 minutes:

    Kubernetes e2e suite: [It] [sig-storage] Flexvolumes should be mountable
    when non-attachable 	6m4s

The only reason why these tests passed is that WaitForPodTerminatedInNamespace
used to return the "not found" API error. That is not guaranteed and about to
change.
2023-02-06 15:39:12 +01:00
Antonio Ojea
7f5ae1c0c1
Revert "e2e: wait for pods with gomega" 2023-02-06 12:08:22 +01:00
Kubernetes Prow Robot
cf14b50b0d
Merge pull request #114502 from cpanato/go1.20
[go] Bump images, dependencies and versions to go 1.20
2023-02-04 13:40:28 -08:00
Kubernetes Prow Robot
85aa0057c6
Merge pull request #113298 from pohly/e2e-wait-for-pods-with-gomega
e2e: wait for pods with gomega
2023-02-04 05:26:29 -08:00
David Porter
039a848274 test: Add e2e node test to check for unknown pods
Unknown pods are pods which are unknown pods to the kubelet, but are still
running in the container runtime. If kubelet detects a pod which is not in
the config (i.e. not present in API-server or static pod), but running as
detected in container runtime, kubelet should aggressively terminate the pod.

This situation can be encountered if a pod is running, then kubelet is
stopped, and while stopped, the manifest is deleted (by force deleting the
API pod or deleting the static pod manifest), and then restarting the
kubelet. Upon restart, kubelet will see the pod as running via the container
runtime, but it will not be present in the config, thus making the pod a
"unknown pod". Kubelet should then proceed to terminate these unknown pods.

Add two tests that ensure that unknown pods will be terminated (1)
static pods and (2) API pods. The test will start a pod, stop the
kubelet, force delete the pod (by deleting the manifest or force
deleting the pod), and then restarting the kubelet. The container
runtime is then queried to ensure the containers are terminated by
kubelet.

Signed-off-by: David Porter <david@porter.me>
2023-02-03 23:04:45 -08:00
David Porter
c2923c472d test: Move waitForAllContainerRemoval() into node e2e util
This is used across multiple tests, so let's move into the util file.

Also, refactor it a bit to provide a better error message in case of a
failure.

Signed-off-by: David Porter <david@porter.me>
2023-02-03 23:04:35 -08:00
cpanato
b9ddf07a75
[go] Bump images, dependencies and versions to go 1.20
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-02-03 22:55:24 +01:00
pwschuurman
7bf175d5a2
Add integration tests for StatefulSetStartOrdinal feature (#115466)
* Add integration tests for StatefulSetStartOrdinal feature

* Move expensive test setup (apiserver and running controller) to be run once in StatefulSetStartOrdinal parameterized tests
2023-02-03 05:26:29 -08:00
Maciej Szulik
8b48ff3584
Don't explicitly set image version in tests
Image versions are already explicitly set in our manifests
configuration, so tests should not be setting these values
to ensure we're using the same versions across the board.
2023-02-02 19:06:00 +01:00
Mengjiao Liu
6f2cd1b5bd Update pkg/controller/cronjob/ for contextual logging 2023-02-02 14:27:13 +08:00
Kubernetes Prow Robot
f97d14c6c8
Merge pull request #115453 from sarveshr7/multicidr-tests
Add integration tests for MultiCIDRRangeAllocator
2023-02-01 12:21:45 -08:00
Kubernetes Prow Robot
d415647739
Merge pull request #115441 from bobbypage/busybox-mirror-test
test: Use preloaded busybox image in mirror pod test
2023-02-01 12:21:36 -08:00
Sarvesh Rangnekar
9875c1b661 Add integration tests for MultiCIDRRangeAllocator
Adds integration tests for the following scenarios with
MultiCIDRRangeAllocator enabled:
- ClusterCIDR is released when an associated node is deleted.
- ClusterCIDR delete when a node is associated, validate the finalizer
  behavior, make sure that deleted ClusterCIDR is cleaned up after the
  associated node is deleted.
- ClusterCIDR marked as terminating due to deletion must not be used for
  allocating PodCIDRs to new nodes.
- Tie break behavior when multiple ClusterCIDRs are eligible to
  allocate PodCIDRs to a node.
2023-02-01 13:48:07 +00:00
Kubernetes Prow Robot
36450ee422
Merge pull request #115423 from pohly/scheduler-perf-goroutine-leak
scheduler perf: goroutine leak
2023-02-01 04:51:06 -08:00
Patrick Ohly
a7f658e442 test/integration: fix Broadcaster leak
When starting a scheduler, the event broadcaster for it wasn't stopped.
2023-02-01 12:42:50 +01:00
Kubernetes Prow Robot
3a4cef70f2
Merge pull request #115445 from bobbypage/gh-115381
test: Fix node e2e device plugin flake
2023-02-01 02:55:06 -08:00
Kubernetes Prow Robot
bb7c9739a3
Merge pull request #114759 from my-git9/chore/k8staint
chore: add k8s node-role.kubernetes.io/control-plane taint
2023-01-31 21:01:17 -08:00
David Porter
225658884b test: Fix node e2e device plugin flake
The device plugin test expects that no other pods are running prior to
the test starting. However, it has been observed that in some cases
some resources may still be around from previous tests. This is because
the deletion of resources from other tests is handled by deleting that
test's framework's namespace which is done asynchronously without
waiting for the other test's namespace to be deleted.

As a result, when the node e2e device plugin starts, there may still be
other pods in process of termination. To work around this, add a retry
to the device plugin test to account for the time it takes to delete the
resources from the prior test.

Signed-off-by: David Porter <david@porter.me>
2023-01-31 17:36:10 -08:00
Kubernetes Prow Robot
046595f11f
Merge pull request #115437 from bobbypage/115219-followup
test: Update runtime class detection logic
2023-01-31 17:05:19 -08:00
Kubernetes Prow Robot
abf8f35356
Merge pull request #113896 from nilekhc/kms-hot-reload-tests
chore: improves tests for hot reload of encryptionconfig
2023-01-31 15:50:53 -08:00
David Porter
a3291a87d7 test: Use preloaded busybox image in mirror pod test
Instead of hardcoding the busybox image, use the one that is preloaded
during the test using imageutils.

Signed-off-by: David Porter <david@porter.me>
2023-01-31 13:34:13 -08:00
David Porter
83652673b6 test: Update runtime class detection logic
In the `NodeSupportsPreconfiguredRuntimeClassHandler`, update the check
for the runtime handler to return a failure if the
`/etc/containerd/config.toml` or `/etc/crio/crio.conf` config files do
not exist. If an error is returned, then the underlying test will be
skipped.

Test manually with starting a kind cluster and moving the containerd
config file and verifying that the test is skipped:

```
$ docker exec -it kind-worker /bin/bash
root@kind-worker:/# mv /etc/containerd/config.toml /etc/containerd/config.toml.bak
```

```
make WHAT="test/e2e/e2e.test"
$ ./_output/bin/e2e.test -kubeconfig /tmp/kubeconfig_kind -ginkgo.focus=".*should run a Pod requesting a RuntimeClass with a configured handler.*" --num-nodes=1 2>&1 -ginkgo.v=1 | tee -i "/tmp/build-log.txt"

[sig-node] RuntimeClass [It] should run a Pod requesting a RuntimeClass with a configured handler [NodeFeature:RuntimeHandler]
test/e2e/common/node/runtimeclass.go:85

  [SKIPPED] Skipping test as node does not have E2E runtime class handler preconfigured in container runtime config: command terminated with exit code 1
```

Signed-off-by: David Porter <david@porter.me>
2023-01-31 11:38:49 -08:00
Antonio Ojea
5b22b13f68 Revert "Add integration tests for MultiCIDRRangeAllocator"
This reverts commit 203b91c486.
2023-01-31 17:13:23 +00:00
Kubernetes Prow Robot
eaa5104dee
Merge pull request #115214 from ii/create-apiservice-test-v4
Write APIService lifecycle test + 4 Endpoints
2023-01-31 07:38:49 -08:00
Kubernetes Prow Robot
c2299bc65f
Merge pull request #115411 from bobbypage/gh-115380
test: Bump timeout for `runPausePod`
2023-01-31 05:25:02 -08:00
Patrick Ohly
222f655062 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-01-31 13:01:39 +01:00
Patrick Ohly
5973e2c8cb e2e pod: unit test for pod status + API error
This covers new behavior in gomega.
2023-01-31 13:01:39 +01:00
Patrick Ohly
901928cd54 e2e pod: remove dead code 2023-01-31 13:01:39 +01:00
Patrick Ohly
f5782f1dbd e2e pod: use gomega.Eventually in WaitForRestartablePods 2023-01-31 13:01:39 +01:00
Patrick Ohly
5d8e970be6 e2e pod: convert ProxyResponseChecker into matcher
Instead of pod responses being printed to the log each time polling fails, we
get a consolidated failure message with all unexpected pod responses if (and
only if) the check times out or a progress report gets produced.
2023-01-31 13:01:39 +01:00
Patrick Ohly
3b579fca91 e2e: consolidate pod response checking
This renames PodsResponding to WaitForPodsResponding for the sake of
consistency and adds a timeout parameter. That is necessary because some other
users of NewProxyResponseChecker used a much lower timeout (2min vs. 15min).

Besides simplifying some code, it also makes it easier to rewrite
ProxyResponseChecker because it only gets used in WaitForPodsResponding.
2023-01-31 13:01:39 +01:00
Patrick Ohly
4491c80074 e2e pod: use gomega.Eventually in WaitForPodNotFoundInNamespace 2023-01-31 13:01:39 +01:00
Patrick Ohly
6eea1b2efa e2e: replace WaitForPodToDisappear with WaitForPodNotFoundInNamespace
WaitForPodToDisappear was always called such that it listed all pods, which
made it less efficient than trying to get just the one pod it was checking for.

Being able to customize the poll interval in practice wasn't useful, therefore
it can be replaced with WaitForPodNotFoundInNamespace.
2023-01-31 13:01:39 +01:00
Kubernetes Prow Robot
f8cb002452
Merge pull request #115291 from sarveshr7/multicidr-tests
Add integration tests for MultiCIDRRangeAllocator
2023-01-31 01:47:00 -08:00
Stephen Heywood
27c8184e17 Update Conformance metadata for e2e test 2023-01-31 22:09:42 +13:00
Stephen Heywood
539d0a0f6c Create APIService lifecycle e2e test
The test validates the following endpoints
- deleteApiregistrationV1CollectionAPIService
- patchApiregistrationV1APIServiceStatus
- replaceApiregistrationV1APIService
- replaceApiregistrationV1APIServiceStatus
2023-01-31 20:47:51 +13:00
Patrick Ohly
4740d34edb e2e: consolidate checking a pod list
WaitForPods is now a generic function which lists pods and then checks the pods
that it found against some provided condition. A parameter determines how many
pods must be found resp. match the condition for the check to succeed.
2023-01-31 07:52:26 +01:00
Patrick Ohly
cd0c756c72 e2e pod: use gomega.Eventually in WaitTimeoutForPodReadyInNamespace/WaitForPodCondition
These get converted together because they relied on FinalErr which now isn't
needed anymore.
2023-01-31 07:52:26 +01:00
Patrick Ohly
5c1723d81f e2e framework: support getting list of objects
This is similar to the previous support for getting a single object.
2023-01-31 07:52:26 +01:00
Patrick Ohly
671835e976 e2e pod: use gomega.Eventually in WaitForPodsRunningReady
The code becomes simpler (78 insertions, 91 deletions), easier to read (all
code entirely inside WaitForPodsRunningReady, no need to declare and later
overwrite variables) and possibly more correct (if all API calls failed,
the resulting error was ignored when allowedNotReadyPods > 0).
2023-01-31 07:52:26 +01:00
Patrick Ohly
b6ede21ff1 e2e framework: turn function into gomega.Matcher
The intention is to use this inside a helper function where the
corresponding Expect call is known.
2023-01-31 07:52:26 +01:00
Patrick Ohly
3ebab68c8a e2e: remove unused label filter from WaitForPodsRunningReady
None of the users of the functions passed anything other than nil or an empty
map and the implementation ignore the parameter - it seems like a candidate for
simplification.
2023-01-31 07:52:26 +01:00
Patrick Ohly
1b5da1035a e2e framework: include additional stack backtrace in failures
When a Gomega failure is converted to an error, the stack at the time when the
failure occurs may be useful: error wrapping provides some bread crumbs that
can be followed to determine where the failure really occurred, but error
wrapping may be missing or ambiguous.

To provide the additional information, a FailureError now includes a full stack
backtrace. The backtrace intentionally makes no attempt to exclude framework
functions besides the gomega support itself because helpers like
e2e/framework/pod may be relevant.

That backtrace is not included in the failure message for the sake of
brevity. Instead, it gets logged as part of the test's output.
2023-01-31 07:52:26 +01:00
Patrick Ohly
e8a50b0583 e2e framework: implement pod polling with gomega.Eventually
gomega.Eventually provides better progress reports: instead of filling up the
log with rather useless one-line messages that are not enough to to understand
the current state, it integrates with Gingko's progress reporting (SIGUSR1,
--poll-progress-after) and then dumps the same complete failure message as
after a timeout. That makes it possible to understand why progress isn't
getting made without having to wait for the timeout.

The other advantage is that the failure message for some unexpected pod state
becomes more readable: instead of encapsulating it as "observed object" inside
an error, it directly gets rendered by gomega.
2023-01-31 07:52:26 +01:00
Patrick Ohly
0872e8d927 e2e framework: gomega assertions as errors
Calling gomega.Expect/Eventually/Consistently deep inside a helper call chain
has several challenges:
- the stack offset must be tracked correctly, otherwise the callstack
  for the failure starts at some helper code, which is often not informative
- augmenting the failure message with additional information from each
  caller implies that each caller must pass down a string and/or format
  string plus arguments

Both challenges can be solved by returning errors:
- the stacktrace is taken at that level where the error is
  treated as a failure instead of passing back an error, i.e.
  inside the It callback
- traditional error wrapping can add additional information, if
  desirable

What was missing was some easy way to generate an error via a gomega
assertion. The new infrastructure achieves that by mirroring the
Gomega/Assertion/AsyncAssertion interfaces with errors as return values instead
of calling a fail handler.

It is intentionally less flexible than the gomega APIs:
- A context must be passed to Eventually/Consistently as first
  parameter because that is needed for proper timeout handling.
- No additional text can be added to the failure through this
  API because error wrapping is meant to be used for this.
- No need to adjust the callstack offset because no backtrace
  is recorded when a failure occurs.

To avoid the useless "unexpected error" log message when passing back a gomega
failure, ExpectNoError gets extended to recognize such errors and then skips
the logging.
2023-01-31 07:52:26 +01:00
Patrick Ohly
b3366ce895 e2e storage: remove WaitForPodTerminatedInNamespace
Calling WaitForPodTerminatedInNamespace after testFlexVolume is useless because
the client pod that it waits for always gets deleted by testVolumeClient:

0fcc3dbd55/test/e2e/framework/volume/fixtures.go (L541-L546)

Worse, because WaitForPodTerminatedInNamespace treats "not found" as "must keep
polling", these two tests always kept waiting for 5 minutes:

    Kubernetes e2e suite: [It] [sig-storage] Flexvolumes should be mountable
    when non-attachable 	6m4s

The only reason why these tests passed is that WaitForPodTerminatedInNamespace
used to return the "not found" API error. That is not guaranteed and about to
change.
2023-01-31 07:52:26 +01:00
Kubernetes Prow Robot
f9a3fd2810
Merge pull request #115346 from gnufied/set-staging-path-expansion
Set node_stage_path whenever available
2023-01-30 21:38:47 -08:00
David Porter
71719a6036 test: Bump timeout for runPausePod
The `runPausePod` timeout was 1 minute previously which appears to be
too short and timing out in some tests.

Switch to `f.Timeouts.PodStartShort` which is the common timeout used to wait
for pods to start which defaults to 5min.

Also refactor to remove `runPausePodWithoutTimeout` and instead rely on
`runPausePod` since we do not make the timeout customizable directly
(it can be changed via the test framework if desired).

Signed-off-by: David Porter <david@porter.me>
2023-01-30 21:27:59 -08:00
Kubernetes Prow Robot
981c4d59fb
Merge pull request #115155 from adrianreber/2023-01-18-checkpoint-test-result
Extend checkpoint e2e test to check for results
2023-01-30 18:43:16 -08:00
Kubernetes Prow Robot
4df945853e
Merge pull request #115137 from swatisehgal/topologymgr-metrics
node: topologymgr: add metrics about admission requests and errors
2023-01-30 18:43:00 -08:00
Kubernetes Prow Robot
3244ebd532
Merge pull request #113973 from my-git9/invalidurl
fix invalid url
2023-01-30 18:42:48 -08:00
Kante Yin
3d0894fabf
Fix failure(context canceled) in scheduler_perf benchmark (#114843)
* Fix failure in scheduler_perf benchmark

Signed-off-by: Kante Yin <kerthcet@gmail.com>

* Fatal when error in cleaning up nodes in scheduler perf tests

Signed-off-by: Kante Yin <kerthcet@gmail.com>

* Use derived context to better organize the codes

Signed-off-by: Kante Yin <kerthcet@gmail.com>

* Change log level to 2 in scheduler perf-test

Signed-off-by: Kante Yin <kerthcet@gmail.com>

---------

Signed-off-by: Kante Yin <kerthcet@gmail.com>
2023-01-30 16:21:00 -08:00
Kubernetes Prow Robot
2eb2c88b1d
Merge pull request #109869 from mauriciopoppe/ephemeral-generic-patch-sc
Skip Generic Ephemeral Volume tests if VolumeBindingMode is immediate and it's a multi-topology environment
2023-01-30 16:20:48 -08:00
Nilekh Chaudhari
b3f326722d
chore: improves tests
Signed-off-by: Nilekh Chaudhari <1626598+nilekhc@users.noreply.github.com>
2023-01-30 23:18:14 +00:00
Kubernetes Prow Robot
d863d04adc
Merge pull request #114580 from pohly/e2e-ginkgo-timeout-fixes
e2e ginkgo timeout fixes, III
2023-01-30 13:48:48 -08:00
Sarvesh Rangnekar
203b91c486 Add integration tests for MultiCIDRRangeAllocator
Adds integration tests for the following scenarios with
MultiCIDRRangeAllocator enabled:
- ClusterCIDR is released when an associated node is deleted.
- ClusterCIDR delete when a node is associated, validate the finalizer
  behavior, make sure that deleted ClusterCIDR is cleaned up after the
  associated node is deleted.
- ClusterCIDR marked as terminating due to deletion must not be used for
  allocating Pod CIDRs to new nodes.
- Tie break behavior when multiple ClusterCIDRs are eligible to
  allocate Pod CIDRs to a node.
2023-01-30 20:42:55 +00:00
Chris Henzie
dbc7d8ded0 feat: support preemption for pods using ReadWriteOncePod PVCs
PVCs using the ReadWriteOncePod access mode can only be referenced by a
single pod. When a pod is scheduled that uses a ReadWriteOncePod PVC,
return "Unschedulable" if the PVC is already in-use in the cluster.

To support preemption, the "VolumeRestrictions" scheduler plugin
computes cycle state during the PreFilter phase. This cycle state
contains the number of references to the ReadWriteOncePod PVCs used by
the pod-to-be-scheduled.

During scheduler simulation (AddPod and RemovePod), we add and remove
reference counts from the cycle state if they use any of these
ReadWriteOncePod PVCs.

In the Filter phase, the scheduler checks if there are any PVC reference
conflicts, and returns "Unschedulable" if there is a conflict.

This is a required feature for the ReadWriteOncePod beta. See for more context:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2485-read-write-once-pod-pv-access-mode#beta
2023-01-30 10:59:22 -08:00
Kubernetes Prow Robot
4b074c816e
Merge pull request #115298 from knelasevero/StartTestServerCtx
Pass context to StartTestServer to get contextualized logger from it during tests
2023-01-30 09:07:12 -08:00
Kubernetes Prow Robot
97636ed781
Merge pull request #115382 from liggitt/typecheck-stdlib
Avoid typechecking stdlib
2023-01-29 16:15:00 -08:00
Jordan Liggitt
a5d7f516d4
Avoid typechecking stdlib 2023-01-28 23:32:50 -05:00
Kubernetes Prow Robot
8e642d3d0d
Merge pull request #115310 from mzaian/etcd-3.5.7-build-image
etcd: Update to version 3.5.7
2023-01-28 10:20:42 -08:00
Kubernetes Prow Robot
86455ae12e
Merge pull request #115094 from GCES-Kubernetes-2022-2/e2e-apps
E2e apps
2023-01-28 08:52:34 -08:00
Paulo Gonçalves Lima
d1278a0830 Fix: Improves the log for failing tests in e2e/apps.
Issue #105678
2023-01-28 02:50:32 -03:00
songxiao-wang87
8c7f3c2116 Making a run test.
Signed-off-by: songxiao-wang87 <wang.xiaosong23@zte.com.cn>
2023-01-28 03:14:57 +00:00
Hemant Kumar
32851bb316 Add e2e for node expansion with missing staging path 2023-01-27 16:51:21 -05:00
Mohamed Zaian
90570b7595 etcd: Update to version 3.5.7 2023-01-27 17:24:00 +01:00
Richa Banker
452343367c Enable ComponentSLIs as beta feature 2023-01-26 17:46:21 -08:00
Richa Banker
eb55e2b980 Add e2e test for checking /metrics/slis endpoint for API server 2023-01-26 17:46:21 -08:00
Kubernetes Prow Robot
cec91d9c00
Merge pull request #115219 from bobbypage/gh-108804-skipper
e2e node: Update runtime class handler skip logic
2023-01-26 17:42:25 -08:00
Kubernetes Prow Robot
0e6f4d3a35
Merge pull request #115271 from kevindelgado/field-validation-conformance
Field validation e2e tests and GA graduation
2023-01-26 09:34:26 -08:00
Kubernetes Prow Robot
ea09f81009
Merge pull request #115311 from atwamahmoud/fix-scaleup-hpa-e2e-tests
Decrease target value for scale up tests in HPA
2023-01-26 07:34:26 -08:00
Kevin Delgado
2d5ceb9b15 drop Enabled() checks for ServerSideFieldValidation feature gate 2023-01-26 14:16:58 +00:00
Kubernetes Prow Robot
3d6c7efc23
Merge pull request #115322 from aojea/hotfix
Fix panic on ClusterIP allocation for /28 subnets
2023-01-26 00:38:26 -08:00
David Porter
6cb022ff4a test: Update Host Exec to support node e2e
Node E2E tests do not run a scheduler, so the host exec pod must have
the `spec.nodeName` set explicitly.

Signed-off-by: David Porter <david@porter.me>
2023-01-26 00:37:01 -08:00
Kubernetes Prow Robot
fab126d7f3
Merge pull request #113121 from aramase/expiring-cache
kmsv2: implement expire cache with clock
2023-01-25 19:04:25 -08:00
Anish Ramasekar
4804baa011
kmsv2: implement expire cache with clock
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2023-01-25 22:50:32 +00:00
Antonio Ojea
ea99593fa1 Fix panic on ClusterIP allocation for /28 subnets
The ClusterIP allocator tries to reserve on part of the ServiceCIDR
to allocate static IPs to the Services.

The heuristic of the allocator to obtain the offset was taking into
account the whole range size, not the IPs available in the range, the
subnet address and the broadcast address for IPv4 are not available.

This caused that for CIDRs with 16 hosts, /28 for IPv4 and /124 for
IPv6, the offset calculated was higher than the max number of available
addresses on the allocator, causing this to panic.

Change-Id: I6c6f527b0a600b3612be37769e405b8fb3dd33a8
2023-01-25 20:32:40 +00:00
Mahmoud Atwa
72d96f61d0 Decrease target value for scale up tests in HPA 2023-01-25 12:58:38 +00:00
David Porter
b96290c08f e2e node: Update runtime class handler skip logic
There are two runtime class tests which required the container runtime
config to include explicit configuration for `test-handler`. The current
logic skips these tests in non GCE environments. This skip is too strict
since the test is skipped in node e2e environments and in other
environments such as kind, which support running the test and also
configure `test-handler`.

Instead of skipping based on provider, add a new function
`NodeSupportsPreconfiguredRuntimeClassHandler` which examines the
underlying container runtime config and checks if the config includes
`test-handler`. The check is a bit brittle since it assumes container
runtime config paths, but it is a net improvement over skipping the test
entirely on non GCE environments.

This results in the test working in the common test environments, namely
GCE kube-up, node e2e, and kind.

Signed-off-by: David Porter <david@porter.me>
2023-01-24 14:43:24 -08:00
Lucas Severo Alves
096d2e5895 remove unwanted newlines 2023-01-24 21:45:32 +01:00
Kevin Delgado
3b6c4d307f Graduate field validation to GA 2023-01-24 17:48:57 +00:00
Kubernetes Prow Robot
703361f381
Merge pull request #115283 from daman1807/master
e2e/network_policy: using expected==observed as condition for polling probeConnectivity
2023-01-24 09:04:17 -08:00
Lucas Severo Alves
636f8e1a3e chore: changes needed before #111155 2023-01-24 17:55:32 +01:00
Kubernetes Prow Robot
c801053791
Merge pull request #115259 from MikeSpreitzer/fix115200
More carefully compose RequestURI for metrics request
2023-01-24 03:58:27 -08:00
Kubernetes Prow Robot
765f2ef7c7
Merge pull request #114981 from adisky/revert
[Test] Revert "Fix:[Flake] [sig-node] Restart [Serial] [Slow] [Disruptive] K…
2023-01-24 03:58:15 -08:00
Daman
a832d1dbdf e2e/network_policy: using expected==observed as condition for polling in probeConnectivity function 2023-01-24 03:59:01 +05:30
Kevin Delgado
f45505d19a Conformance tests for server side field validation 2023-01-23 18:30:58 +00:00
Adrian Reber
86b62b86d8
Extend checkpoint e2e test to check for results
When the e2e_node/checkpoint_container.go test was introduced no CRI
implementation supported the new CheckpointContainer RPC yet.

With the release of CRI-O 1.25 the CheckpointContainer is implemented
and the test has been extended to see if the content of the checkpoint
is as expected.

The test is skipped if the ContainerCheckpoint feature gate is disabled
or if the CRI implementation does not support the CheckpointContainer
RPC.

Signed-off-by: Adrian Reber <areber@redhat.com>
2023-01-23 18:07:35 +00:00
Mike Spreitzer
1d199db03e Carefully compute request path for metrics
Preserve the previx before "api/v1".
2023-01-23 09:44:21 -05:00
Patrick Ohly
bc6c7fa912 logging: fix names of keys
The stricter checking with the upcoming logcheck v0.4.1 pointed out these names
which don't comply with our recommendations in
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments.
2023-01-23 14:24:29 +01:00
Kubernetes Prow Robot
0fcc3dbd55
Merge pull request #115240 from thockin/codegen-9-use-ls-files
Use `git ls-files` in a few places instead of `find`
2023-01-23 00:26:21 -08:00
Kubernetes Prow Robot
bec431642e
Merge pull request #115254 from dims/do-not-use-global-variable-for-etcd-url
Do not use a global variable for etcdURL
2023-01-22 15:26:15 -08:00
Tim Hockin
7229364f0a
Make generated-stable-metrics use git ls-files 2023-01-22 15:22:55 -08:00
Kubernetes Prow Robot
5a3540f462
Merge pull request #114825 from pohly/e2e-pod-consistently-pending
e2: fix check of "pod is consistently pending"
2023-01-22 12:56:02 -08:00
Davanum Srinivas
1671efe7a8
Do not use a global variable for etcdURL
we are saving this information in an env variable `KUBE_INTEGRATION_ETCD_URL`

So just pick it up from there when needed. Currently when someone uses
framework.RunCustomEtcd directly, the global variable is *not* set and the
code that uses `GetEtcdURL` returns empty string.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-01-22 14:11:26 -05:00
Kubernetes Prow Robot
d9c371a2c4
Merge pull request #115207 from daman1807/master
e2e/network_policy: using Poll Immediate for intra pod connectivity probes
2023-01-20 21:18:02 -08:00
Kubernetes Prow Robot
92f0818cf2
Merge pull request #114609 from pohly/log-runtime-verbosity-level
runtime log verbosity level changes
2023-01-20 19:34:02 -08:00
Kubernetes Prow Robot
b0ed87078e
Merge pull request #115113 from smarterclayton/exponential_context
wait: ExponentialBackoffWithContext should take context-aware fn
2023-01-20 07:38:15 -08:00
Daman
faee4c33de e2e/network_policy: using PollImmediate for intra pod connectivity probes 2023-01-20 20:05:28 +05:30
Kubernetes Prow Robot
02f893b6e2
Merge pull request #115125 from adisky/update-cni-version
Update CNI version to 1.2.0
2023-01-20 03:34:15 -08:00
Kubernetes Prow Robot
5fe3563ad7
Merge pull request #114915 from brianwang12/master
test images: Update CudaVectorAdd test image to support arm64
2023-01-19 20:30:14 -08:00
Kubernetes Prow Robot
56a14025b0
Merge pull request #115193 from SataQiu/update-storage-api-20230119
apiserver: update serialization version priority for policy API
2023-01-19 13:44:15 -08:00
Kubernetes Prow Robot
285e7969b2
Merge pull request #114544 from ritazh/kmsv2-keyid-staleness
[KMSv2] Use status key ID to determine staleness of encrypted data
2023-01-19 10:28:16 -08:00
Rita Zhang
510ac9b391
kmsv2: use status key ID to update staleness of encrypted data
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2023-01-19 08:09:24 -08:00
Swati Sehgal
340db7109d node: e2e: topologymgr: add tests for topology manager metrics
Add node e2e tests to verify population of topology metrics.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2023-01-19 14:40:37 +00:00
Swati Sehgal
51c6a1fbe7 node: e2e: cpumgr: Rename: s/getCPUManagerMetrics/getKubeletMetrics
Since we need to gather kubelet metrics for CPU Manager and Topology
Manager, renaming this function to a more generic name.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2023-01-19 14:18:05 +00:00
SataQiu
571582b5b2 apiserver: update serialization version priority for policy API 2023-01-19 14:42:26 +08:00
briwan01
2aed699d8c test images: Update CudaVectorAdd test image to support arm64
Signed-off-by: briwan01 <Brian.Wang@arm.com>
2023-01-19 10:18:17 +08:00
Kubernetes Prow Robot
dfbe1c0120
Merge pull request #113789 from jsafrane/add-selinux-tests
Add multi-pod tests with SELinux mounts
2023-01-18 14:48:46 -08:00
Mike Danese
6bdb8ed566 switch spdy round trip tests to simple http proxy
github.com/elazarl/goproxy does not properly handle upgrades over HTTP
proxy. The problem is this misinterpretation:

6691876326/vendor/github.com/elazarl/goproxy/proxy.go (L89-L95)

These should be stripped but recalculated then added back:

https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/net/http/httputil/reverseproxy.go;l=292-297;drc=f6d844510d5f1e3b3098eba255d9b633d45eac3b

Let's just stop using goproxy, and use the stdlib instead. The
functionality we need is straightforward to implement and goproxy is
overkill.
2023-01-18 18:31:50 +00:00
Viacheslav Panasovets
6adf60fdf4
Do not create endpoints if service of type ExternalName (#114814) 2023-01-18 03:12:34 -08:00
Aditi Sharma
d83c37c311 Update CNI version to 1.2.0
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2023-01-18 13:24:40 +05:30
Kubernetes Prow Robot
46f3821bf4
Merge pull request #114586 from andrewsykim/apiserver-lease-rename
Rename apiserver identity lease labels to apiserver.kubernetes.io/identity
2023-01-17 21:36:34 -08:00
Kubernetes Prow Robot
84200d0470
Merge pull request #115135 from Jefftree/rename-enum-integration
Rename enum openapi test
2023-01-17 16:06:47 -08:00
Kubernetes Prow Robot
c913e6ce62
Merge pull request #114542 from pacoxu/EphemeralContainers
cleanup: EphemeralContainers feature gate related codes
2023-01-17 11:18:34 -08:00
Kubernetes Prow Robot
f7b02260f6
Merge pull request #114922 from ibihim/kmsv2-interface-move
[KMSv2] apiserver/kmsv2: mv Service interface into kmsv2
2023-01-17 10:10:33 -08:00
Jefftree
a26174155d Rename enum integration test 2023-01-17 17:22:24 +00:00
Rahul Rangith
8924b58e2c Cleanup statefulset after e2e test 2023-01-17 10:21:42 -05:00
Rahul Rangith
392cd5ce8c Make e2e test not rely on local volumes 2023-01-17 10:21:42 -05:00
Rahul Rangith
e6a90aa48a PR feedback 2023-01-17 10:21:41 -05:00
Rahul Rangith
c1cc18ccd5 Automatically recreate pvc when sts pod is stuck in pending 2023-01-17 10:21:41 -05:00
Maciej Szulik
3d3da44e96
Wait for logs pod to complete before counting lines 2023-01-17 13:39:35 +01:00
Jan Safranek
b9c2449569 Rework createSELinuxMountPreHook to switch() 2023-01-17 11:23:19 +01:00
Jan Safranek
d2bb866d3f Remove useless Sprintf 2023-01-17 11:22:39 +01:00
Jan Safranek
de4ce7b58c Remove defer
Replace it with ginkgo.DeferCleanup
2023-01-17 11:22:12 +01:00
Patrick Ohly
a41424d4c8 k8s.io/component-base/logs: allow overriding os.Stdout and os.Stderr
This is useful for tests which need to discard or capture the output.
2023-01-17 10:25:57 +01:00
Patrick Ohly
9b86f457e9 k8s.io/component-base/logs: support changing verbosity of JSON output
The GlogSetter method is used by three components to change verbosity at
runtime through HTTP APIs. This used to work only for text output with klog
calls, but not for text output through the klog logger or for JSON output.

Now loggers can also provide a callback for changing their verbosity at
runtime. Implementing that implies that the Create factory method has to be
extended, which is an API break for the Go package, but not an API break for
the configuration file and command line flags, which is what matters for the
"api/v1" component API.
2023-01-17 10:25:54 +01:00
Krzysztof Ostrowski
b7701b00ea
apiserver/kmsv2: mv Service interface into kmsv2
Signed-off-by: Krzysztof Ostrowski <kostrows@redhat.com>
2023-01-17 10:05:16 +01:00
Paco Xu
ae574993c2 cleanup(kubectl-e2e): remove invalid comments 2023-01-17 10:13:21 +08:00
Clayton Coleman
34bfdc3635
wait: ExponentialBackoffWithContext should take context-aware fn
The condition methods will eventually all take a context. Since we
have been provided one, alter the accepted condition type and
change the four references in tree.

Collers of ExponentialBackoffWithContext should use a condition
aware function (ConditionWithContextFunc). If the context can be
ignored the helper ConditionFunc.WithContext can be used to convert
an existing function to the new type.
2023-01-16 14:57:57 -05:00
Kubernetes Prow Robot
62d7937b2e
Merge pull request #115046 from pacoxu/default-container-e2e
add e2e test for kubectl default container annotation
2023-01-16 08:42:50 -08:00
Paco Xu
b45f0a8def move kubectl log e2e to new file & add e2e test for kubectl default container annotation
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-01-16 21:29:43 +08:00
Patrick Ohly
6af5bf0585 e2e: enhance tests that check for pod staying pending
Using WaitTimeoutForPodRunningInNamespace followed by ExpectError was not very
precise (any error passed the check, not just the expected timeout) and
hard to read. Now the test's expectation is spelled out explicitly: the pod
must stay in pending.
2023-01-16 09:12:30 +01:00
Patrick Ohly
6b5f77b163 e2e framework/pod: add gomega matchers
They can be used for polling with a get function and gomega.Eventually or
gomega.Consistently.
2023-01-16 09:05:37 +01:00
Patrick Ohly
17eba2b2f7 e2e framework/pod: add Get helper
This helper will be used by several different tests and makes those tests more
readable.
2023-01-16 09:05:37 +01:00
Patrick Ohly
63ab23200b e2e framework: support polling with Get
These helper functions can be used in combination with
omega.Eventually/Consistently to implement polling of objects that is aware of
Kubernetes apiserver conventions:

- retry on certain errors instead of giving up,
  with "not found" handling decided by the caller (may or may not
  be fatal, depending on the test)
- sleep if requested by apiserver
2023-01-16 09:05:37 +01:00
Patrick Ohly
22341590bd e2e framework: add NamespacedName
The E2E framework contains several functions which only differ in how they get
name and namespace: from an API object (WaitForPodRunningInNamespace) or as
separate parameters (WaitTimeoutForPodRunningInNamespace).

NamespacedName and the NamedObject interface enable writing helper functions
that can be called with both an API object (like *v1.Pod, which implements
Object and thus NamedObject) and name+namespace string (via
NamespacedName).

The other advantage of NamespacedName is that the order of name and namespace
parameter cannot be mixed up.

NamespacedName was derived from k8s.io/apimachinery/pkg/types.NamespacedName. A
separate type in the framework package was chosen a) to avoid additional
imports in test code and b) because the interface might not be suitable for
k8s.io/apimachinery.
2023-01-16 09:05:37 +01:00
Patrick Ohly
1ec4c7a41c e2e framework: add test case for early abort of pod polling
The early exit support was added in 004c1b6441
but without a corresponding test case.
2023-01-16 09:05:36 +01:00
Paco Xu
70e56fa71a cleanup: EphemeralContainers feature gate related codes 2023-01-15 21:15:01 +08:00
Andrew Sy Kim
a7de3e15a5 apiserver: use the identity value in the apiserver identity hash
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-01-13 16:20:14 -05:00
Andrew Sy Kim
fb066a883d apiserver: update lease identity prefix from kube-apiserver- to apiserver-
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-01-13 15:37:22 -05:00
Andrew Sy Kim
423539cf96 test/integration/controlplane: add new apiserver identity test TestLeaseGarbageCollectionWithDeprecatedLabels
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-01-13 15:37:22 -05:00
Andrew Sy Kim
3da0f1809c apiserver: update lease label key to apiserver.kubernetes.io/identity
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
2023-01-13 15:37:22 -05:00
Michal Wozniak
3833c0c349 PodGC should not add DisruptionTarget condition for pods which are in terminal phase 2023-01-13 18:28:44 +01:00
SataQiu
950c147db5 apiserver: update serialization version priority for flowcontrol API 2023-01-13 22:19:39 +08:00
Kubernetes Prow Robot
067fc449cd
Merge pull request #114260 from aojea/kubeproxylagtimeout
be more strict on e2e network timeouts
2023-01-12 16:03:12 -08:00
cpanato
eb38f1508a
releng: Update images, dependencies and version to Go 1.19.5
Signed-off-by: cpanato <ctadeu@gmail.com>
2023-01-12 13:43:57 +01:00
Kubernetes Prow Robot
457341c3d4
Merge pull request #114647 from kannon92/remove-legacy-job-tracking-job-controller
Removing Legacy Job Tracking Code
2023-01-12 04:38:53 -08:00
Kubernetes Prow Robot
0d6dc14051
Merge pull request #114783 from pohly/e2e-framework-timeouts
e2e framework: consolidate timeouts and intervals
2023-01-12 03:29:08 -08:00
Kubernetes Prow Robot
5b241820b7
Merge pull request #114417 from chendave/ginkgo_fix_spec
e2e: bring back total test spec for Ginkgo v2
2023-01-12 03:28:56 -08:00
Kubernetes Prow Robot
08d9a0ef5b
Merge pull request #113467 from pacoxu/psp-cleanup
Remove PodSecurityPolicy related code except client-go & API type
2023-01-11 14:28:07 -08:00
Rafa de Castro
a887a3b4fd
Changed code to improve output messages on error for files under test/e2e/apps (#109944)
* Improving the output of tests in case of error

* Better error message

Also, the condition in the second case was reversed

* Fixing 2 tests whose condition was inverted

* Again I got the conditions wrong

* Sorry for the confusion

* Improved error messages on failures
2023-01-11 02:11:44 -08:00
Aditi Sharma
0a7b2eeae0 Revert "Fix:[Flake] [sig-node] Restart [Serial] [Slow] [Disruptive] Kubelet should correctly account for terminated pods after restart"
This reverts commit 572360c5a5.
2023-01-11 15:05:49 +05:30
Kubernetes Prow Robot
7e97b4b322
Merge pull request #114868 from apelisse/private-internal-managers
fieldmanager: Make internal managers private
2023-01-10 16:33:19 -08:00
Kubernetes Prow Robot
a11ad04564
Merge pull request #114859 from pohly/e2e-ginkgo-spec-ordering
dependencies: update ginkgo to v2.7.0
2023-01-10 15:25:37 -08:00
Kubernetes Prow Robot
eca8503574
Merge pull request #114742 from Transmitt0r/autoscaling-enhance-assertions
Changed remaining code to improve output for files under test/e2e/autoscaling
2023-01-10 10:39:47 -08:00
Kubernetes Prow Robot
1c30eee9a8
Merge pull request #114693 from wzshiming/fix/test
Fix this e2e failure causes subsequent e2e failures altogether
2023-01-10 10:39:36 -08:00
kannon92
6dfaeff33c Remove Legacy Job Tracking 2023-01-10 14:52:54 +00:00
Kubernetes Prow Robot
2ed47bd81b
Merge pull request #114933 from gnufied/disable-multiple-pv-tests-vsphere
Disable multiple pv mount tests for vsphere intree driver
2023-01-10 03:05:26 -08:00
Patrick Ohly
0424c4654e e2e gcp: use timeout from f.Timeouts
This is simpler, no need to construct an entirely new struct anymore.
2023-01-10 11:36:45 +01:00
Kubernetes Prow Robot
d8b553cce8
Merge pull request #114769 from pohly/e2e-owners-pohly
test/OWNERS: add pohly as approver
2023-01-09 15:11:27 -08:00
Hemant Kumar
58e7b97b49 Disable multiple pv mount tests for vsphere intree driver 2023-01-09 16:20:17 -05:00
Patrick Ohly
cb1edc00ef Revert "e2e storage: define local PersistentVolume tests in deterministic order"
This reverts commit 5636418f10. Ginkgo is
now handling the random spec ordering.
2023-01-09 20:55:26 +01:00
Antoine Pelisse
adfc65ec23 Make internal managers private
This significantly reduces the surface area of the fieldmanager package
by hiding all the private "managers" objects, as well as the interface
that was made specifically for these. There is no reason to configure
these.
2023-01-09 10:10:17 -08:00
Patrick Ohly
0f9a8d38be e2e framework: configure poll interval+duration for gomega
Primarily this protects against accidentally polling with the default interval
of 10ms. Setting these defaults may also make some tests simpler because they
don't need to override the defaults.
2023-01-09 17:29:35 +01:00
Patrick Ohly
16a6f70e11 e2e: add PollInterval()
Various different tests all have their own poll intervals. As a start towards
consolidating that, the interval from test/e2e/framework/pod (as one of the
most common cases for polling) is moved into the framework.

Changing other helper packages and tests needs to follow.
2023-01-09 17:29:35 +01:00
Patrick Ohly
db394db398 e2e: move several timeouts from TestContext into TimeoutContext
This consolidates timeout handling. In the future, configuration of all
timeouts via a configuration file might get added. For now, the same three
legacy command line flags for the timeouts that get moved continue to be
supported.
2023-01-09 17:29:35 +01:00
Jan Safranek
03beb014f9 Update error context messages 2023-01-09 14:00:57 +01:00
Patrick Ohly
b721272a1e test/OWNERS: add pohly as approver
As technical lead in SIG Testing it would be useful to have the right to
approve test changes...
2023-01-09 09:54:10 +01:00
Patrick Ohly
c6da602168 OWNERS: remove sig-testing-approvers
It's not used enough to add any real value. Instead, it obscures the real
ownership when someone looks at an OWNERS file where it is used.
2023-01-09 09:54:10 +01:00
Stephen Heywood
befb7d4a6a Promote SubjectAccessReview e2e test to Conformance 2023-01-09 11:24:05 +13:00
Kubernetes Prow Robot
643353abfe
Merge pull request #114885 from enj/enj/i/etcd_path_all_features
Enable all features during etcd storage path test
2023-01-06 21:01:38 -08:00
Monis Khan
32c44b33e8
Enable all features during etcd storage path test
Signed-off-by: Monis Khan <mok@microsoft.com>
2023-01-06 20:41:46 -05:00
Ian K. Coolidge
cbb985a310 cpuset: Delete 'builder' methods
All usage of builder pattern is convertible to cpuset.New()
with the same or fewer lines of code.

Migrate Builder.Add to a private method of CPUSet, with a comment
that it is only intended for internal use to preserve immutable
propoerty of the exported interface.

This also removes 'require' library dependency, which avoids
non-standard library usage.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
f3829c4be3 cpuset: Rename 'NewCPUSet' to 'New' 2023-01-06 23:32:51 +00:00
Ian K. Coolidge
e5143d16c2 cpuset: Make 'ToSlice*' methods look like 'set' methods
In 'set', conversions to slice are done also, but with different names:

ToSliceNoSort() -> UnsortedList()
ToSlice() -> List()

Reimplement List() in terms of UnsortedList to save some duplication.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
a0c989b99a cpuset: Remove *Int64 methods
These are rarely used and can be accommodated with a trivial helper.
2023-01-06 23:32:51 +00:00
Ian K. Coolidge
67a057d4f2 cpuset: Remove 'MustParse' method
Removes exit/fatal from cpuset library.

Usage in podresources test was not necessary.

Library reference in cpu_manager_test was moved to a local function, and
converted to use e2e test framework error catching.
2023-01-06 23:32:51 +00:00
Kubernetes Prow Robot
be9d9a850d
Merge pull request #113959 from Jefftree/jefftree-owners
Update OWNERS for jefftree
2023-01-06 09:59:58 -08:00
Paco Xu
25686a2c77 remove psp in extensions api/apis 2023-01-06 17:07:02 +08:00
Kubernetes Prow Robot
52cb0c28ce
Merge pull request #114820 from TommyStarK/test-integration/replace-deprecated-pointer-function
test/integration: Replace deprecated pointer function
2023-01-05 13:58:11 -08:00
Kubernetes Prow Robot
c6594f6c98
Merge pull request #114848 from TommyStarK/test-e2e/replace-deprecated-pointer-function
test/e2e: Replace deprecated pointer function
2023-01-05 12:54:09 -08:00
Kubernetes Prow Robot
8dd70a16ad
Merge pull request #114699 from kerthcet/feat/distinguish-unschedulabel-with-unresolvable
Distinguish between Unschedulable and UnschedulableAndUnresolvable in scheduler's PostFilter
2023-01-05 12:53:57 -08:00
TommyStarK
a46cfe5d1e test/e2e: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-05 18:43:58 +01:00
TommyStarK
9e885bce35 test/integration: Replace deprecated pointer function
Signed-off-by: TommyStarK <thomasmilox@gmail.com>
2023-01-05 18:38:40 +01:00
Jan Safranek
e1f62a9bc5 Add multi-pod tests with SELinux mounts
Check that a volume is fully unmounted (Unstaged) before kubelet starts a
pod with the same volume, but with a different SELinux context.
2023-01-05 13:15:32 +01:00
Kante Yin
2c205e291d Distinguish unschedulable with unresolvable in scheduler
Before, in RunPostFilterPlugins, we didn't distinguish between unschedulable and unresolvable
because we only have one postFilterPlugin by default, now, we have at least two, we should
make sure that once a postFilterPlugin returns unresolvable, we'll return directly

Signed-off-by: Kante Yin <kerthcet@gmail.com>
2023-01-05 16:59:19 +08:00
ZhangKe10140699
572360c5a5 Fix:[Flake] [sig-node] Restart [Serial] [Slow] [Disruptive] Kubelet should correctly account for terminated pods after restart 2023-01-05 09:10:57 +08:00
Kubernetes Prow Robot
b05aa53fa1
Merge pull request #114796 from sanposhiho/sanposhiho/feature-gate-remove
cleanup(scheduler_perf): remove all removed feature gates
2023-01-04 14:30:32 -08:00
Shiming Zhang
080d4a2a9b Fix this e2e failure causing Kubelet not to restart 2023-01-04 16:15:32 +08:00
Kensei Nakada
e8092cc885 cleanup(scheduler_perf): remove all removed feature gates 2023-01-04 01:07:47 +00:00
Kubernetes Prow Robot
12c71fdf1c
Merge pull request #113542 from ardaguclu/fix-shortname-disperancy
Set singular names for core types to pass to discovery
2023-01-03 09:29:43 -08:00
Patrick Ohly
f0cc053544 e2e framework: enable extending TimeoutContext
If we were to add new fields in TimeoutContext, the current users of
NewFrameworkWithCustomTimeouts might run into failures unless they get modified
to also set those new fields. This is error-prone.

A better approach is to let users of NewFrameworkWithCustomTimeouts override
fields by setting just those and use the normal defaults for the others.
2023-01-03 17:01:33 +01:00
Patrick Ohly
cdb0cd0387 e2e framework: simplify timeout defaults
Filling in the default values directly in the struct eliminates the need to
define constants that aren't used anywhere else.
2023-01-03 16:31:13 +01:00
Lukas Grotz
30c586a647
Update test/e2e/autoscaling/cluster_size_autoscaling.go with suggestions
Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
2023-01-02 20:01:26 +01:00
Patrick Ohly
5636418f10 e2e storage: define local PersistentVolume tests in deterministic order
Ginkgo relies on all workers defining all tests in exactly the same order. This
wasn't guaranteed for these tests, with the result that some tests might have
been executed more than once and others not at all when running in parallel.

This was noticed when some of these tests started to flake and then were
reported both as failure and success, as if they had been retried.
2023-01-02 16:22:11 +01:00
xin.li
10ca605cdd chroe: add k8s node-role.kubernetes.io/control-plane taint
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-01-02 21:04:43 +08:00
Patrick Ohly
6c957c0634 e2e storage: restore timeout behavior in "CSI NodeStage error cases"
In v1.26.0, these tests only used the timeout context while waiting for a CSI
call. This restores that behavior, just in case that it is relevant. No test
flakes are known because of this.
2023-01-02 10:47:09 +01:00
Patrick Ohly
a2722ffa4a e2e: replace WithTimeout with NodeTimeout
The intend of timeout handling (for the entire "It" and not just a few calls)
becomes more obvious and simpler when using ginkgo.NodeTimeout as decorator.
2023-01-02 10:47:00 +01:00
Transmitt0r
50ed17a66e Changed remaining code to improve output for files under test/e2e/autoscaling 2022-12-29 17:42:02 +01:00
Kubernetes Prow Robot
1e523a36b2
Merge pull request #114700 from kerthcet/cleanup/replace-deprecated-function-in-pointer
Replace deprecated pointer function in scheduler tests
2022-12-27 07:59:29 -08:00
Kubernetes Prow Robot
659a792f84
Merge pull request #114709 from thockin/remove_gengo_dep
Remove dep on gengo
2022-12-27 02:15:27 -08:00
Tim Hockin
5b17cd61a9
Remove dep on gengo 2022-12-26 16:23:36 -08:00
Kante Yin
666605498a Replace deprecated pointer function
Signed-off-by: Kante Yin <kerthcet@gmail.com>
2022-12-26 22:06:44 +08:00
Kubernetes Prow Robot
5cdec8f99e
Merge pull request #114667 from Miciah/114666-e2e-remove-kubeadm-ism-in-DNS-HostNetwork-test
e2e: Remove kubeadm-ism in DNS HostNetwork test
2022-12-23 04:11:26 -08:00
Dave Chen
7800dabb62 e2e: comment the known limitation of the ProgressReporter
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-12-23 18:43:49 +08:00