Commit Graph

137 Commits (680bc4b4b5d266c7c0346a0bd23918fa355c3644)

Author SHA1 Message Date
Anthony Yeh a6a5190494
test/e2e: Use apps/v1 Deployment/ReplicaSet.
This must be done at the same time as the controller update,
since they share code.
2018-05-22 13:43:06 -07:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
Kubernetes Submit Queue bed4531131
Merge pull request #61913 from jennybuckley/watch-pod-deadline
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove ActiveDeadlineSeconds from Watch e2e Test

**What this PR does / why we need it**:
I originally updated ActiveDeadlineSeconds because it is one of the few fields on Pods which can change, but I didn't consider how it might affect the reliability of the test. This PR replaces the update done to ActiveDeadlineSeconds with a more predictable update to a label.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Might fix #61846

**Release note**:
```release-note
NONE
```
2018-05-10 10:50:19 -07:00
Jordan Liggitt adfe0ab52f
Make aggregator e2e test resilient to unrelated API group changes 2018-05-09 18:06:02 -04:00
David Eads 5ff923c7f9 make dynamic client slightly easier to use 2018-04-30 08:54:30 -04:00
xuzhonghu 393324497f make use of simple dynamic client in test 2018-04-27 13:38:58 +08:00
Kubernetes Submit Queue ce1cab3bfa
Merge pull request #62350 from jennybuckley/crd-tests-flaky
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Fix flaky crd e2e tests

Fixes #62345

/sig api-machinery
/kind flake
/priority failing-test

From the issue:
> All the tests that rely on creating a CustomResourceDefinition are flaky. This is because the test "AdmissionWebhook Should be able to deny custom resource creation" creates a validating webhook, called deny-crd.k8s.io, which denies all crd creations. This is an issue for any other test which will create a crd that gets run in parallel with that webhook test, causing them to fail with the message failed to create CustomResourceDefinition: admission webhook "deny-crd.k8s.io" denied the request: this webhook denies all requests

This PR changes the test webhook image to support handling a new "/crd" path which would accept and deny crd creations based on their labels, only denying if if the object has the label ```"webhook-e2e-test":"webhook-disallow"```, and updates the "AdmissionWebhook Should be able to deny custom resource creation" test to use that label.

**Release note**:
```release-note
NONE
```
2018-04-13 09:28:44 -07:00
Joe Betz a795cb61bc Bump etcd default server version to 3.2.18 2018-04-11 21:12:44 -07:00
jennybuckley 7fee22b7be Fix flaky crd e2e tests 2018-04-11 14:08:05 -07:00
Manjunath A Kumatagi 1bb810e749 Use pause manifest image 2018-04-06 11:00:50 +05:30
jennybuckley 3fcc269733 Cleanup CRD/CR confusion in webhook e2e tests 2018-04-03 15:14:30 -07:00
Kubernetes Submit Queue 6c96dfd81e
Merge pull request #61025 from ayushpateria/crd_watch_e2e
Automatic merge from submit-queue (batch tested with PRs 61404, 61025). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add e2e test for CRD Watch

**What this PR does / why we need it**:
This adds an e2e test to watch for custom resources. 
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55538

**Special notes for your reviewer**:
This PR depends on some functions from #60331, and shouldn't be merged before that one gets merged.
**Release note**:

```release-note
Add e2e test for CRD Watch
```
2018-04-03 07:31:08 -07:00
hzxuzhonghu 932a072990 add e2e case for crd webhook 2018-04-03 20:42:44 +08:00
Ayush Pateria 121bc9c838 Seperate timer durations for expectEvent and expectNoEvent 2018-04-02 19:42:12 +05:30
Ayush Pateria cbdbcb515b Add e2e test for CRD Watch 2018-04-02 19:40:36 +05:30
jennybuckley 0c37b630e8 Remove ActiveDeadlineSeconds from watch e2e test 2018-03-29 12:11:06 -07:00
Mikhail Mazurskiy c23a8a85cc
Use range in loops; misc fixes 2018-03-29 22:55:25 +11:00
Kubernetes Submit Queue 2919818da8
Merge pull request #61499 from jennybuckley/crd-test-flake
Automatic merge from submit-queue (batch tested with PRs 61378, 60915, 61499, 61507, 61478). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix "Garbage collector should support cascading deletion of custom resources" flake

**What this PR does / why we need it**:
These webhook configuration objects were intended to have no effect on admission requests, and are just used to ensure that webhook configuration objects can always be deleted.

However, I think they are causing an entirely separate test to flake (Garbage collector should support cascading deletion of custom resources) because of the interaction between these two webhooks, which are run on all admission requests, and #61355 (Unable to create/update CRD when mutating webhook configured) when the two tests are run at around the same time.

This PR will make the effects of the webhook e2e test on other tests easier to reason about.

The flakiness is being caused by a legitimate failure of the underlying code (That CRDs currently don't work with webhooks), but not a failure which either of "Garbage collector should support cascading deletion of custom resources" or "AdmissionWebhooks Should not be able to prevent deleting validating-webhook-configurations or mutating-webhook-configurations" is supposed to reliably catch.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #59997

**Release note**:
```release-note
NONE
```

/sig api-machinery
/kind flake
2018-03-22 07:15:26 -07:00
jennybuckley cd06e4db1f Remove wildcard matching of no-op test webhooks 2018-03-21 15:13:43 -07:00
Ryan Hitchman f7da809209 Increase API watch test timeout to avoid flakes. 2018-03-21 13:26:49 -07:00
Kubernetes Submit Queue 2cb4297c96
Merge pull request #59637 from hanxiaoshuai/bugfix0209
Automatic merge from submit-queue (batch tested with PRs 59637, 60611, 60788, 60489, 60687). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix todo: use a better way to keep this label unique in the test

**What this PR does / why we need it**:
fix todo: use a better way to keep this label unique in the test in test/e2e/apimachinery/garbage_collector.go
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-03-20 04:34:31 -07:00
Kubernetes Submit Queue c0db49c2cb
Merge pull request #60331 from jennybuckley/watch-e2e-test
Automatic merge from submit-queue (batch tested with PRs 60457, 60331, 54970, 58731, 60562). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add e2e test for watch

**What this PR does / why we need it**:
Currently watch is only tested by kubectl tests, but all clients of kubernetes should be able to reliably watch resources for changes. This test should be able to accommodate testing watch for custom resources without many changes.

/sig api-machinery

```release-note
Added e2e test for watch
```
2018-03-19 23:42:11 -07:00
jennybuckley 3b2472a305 Add e2e test for watch 2018-03-12 10:48:43 -07:00
Joe Betz e2a25f9b54 Bump to etcd 3.1.12 to pick up critical fix 2018-03-09 14:28:23 -08:00
Shyam Jeedigunta 21f5e69f08 Rollback etcd server version to 3.1.11 due to #60589 2018-03-08 13:07:15 +01:00
Kubernetes Submit Queue 9aae9b58a5
Merge pull request #59836 from jpbetz/etcd-3.2.16-patch-upgrade
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump etcd server patch version to 3.2.16

etcd 3.2.16 contains a critical fix for HA clusters: https://github.com/coreos/etcd/pull/9281

Also, update newly added tests to use `REGISTRY` make variable.

Release note:
```release-note
Upgrade the default etcd server version to 3.2.16
```
2018-03-06 10:00:53 -08:00
Kubernetes Submit Queue 7e98a3ad7c
Merge pull request #60797 from soltysh/issue60765
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Run server-side print tests only on k8s 1.10+

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #60765

**Release note**:
```release-note
None
```

/assign @smarterclayton @deads2k 
@juanvallejo fyi
2018-03-06 02:12:40 -08:00
jennybuckley 58b43ad27d Prevent webhooks from affecting admission requests for webhooks 2018-03-05 16:35:52 -08:00
Joe Betz 04c6d0ab26 Bump etcd server patch version to 3.2.16 2018-03-05 13:58:51 -08:00
Maciej Szulik 64abf5b8ad
Run server-side print tests only on k8s 1.10+ 2018-03-05 17:52:51 +01:00
hangaoshuai ebec856cd3 fix todo: use a better way to keep this label unique in the tests 2018-03-02 09:33:43 +08:00
Kubernetes Submit Queue 6546b69964
Merge pull request #60116 from jennybuckley/gc-conf-test
Automatic merge from submit-queue (batch tested with PRs 60430, 60115, 58052, 60355, 60116). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Garbage Collector e2e conformance tests

**What this PR does / why we need it**:
The garbage collector is a core component of kubernetes and needs to be tested by conformance, so its functionality can be relied on in any kubernetes environment.

As we can see in [testgrid](https://k8s-testgrid.appspot.com/sig-api-machinery#gce), the garbage collector tests being promoted by this PR are consistently passing. And the intention to promote them to conformance tests was laid out by [this document](https://docs.google.com/document/d/1h2S9ff9N-4MKqfayE3A8TqjD_qIwuND_dAhOAJFxYS0)

**Special notes for your reviewer**:
The last two tests in this file are not added as conformance tests because they involve beta features (custom resources and cronjobs), and conformance tests are only allowed for features in GA.

**Release note**:
```release-note
New conformance tests added for the Garbage Collector
```
2018-02-27 09:38:51 -08:00
jennybuckley e6f867d2ca promote GC e2e tests to conformance tests 2018-02-26 11:18:12 -08:00
Clayton Coleman 98cf7e6ae2
generated: bazel 2018-02-22 23:26:25 -05:00
Clayton Coleman 110b064d63
Make Service storage a wrapper around other storages
The registry abstraction is unnecessary and adds direct coupling to the
core types. By using a wrapper, we carry through the default
implementations of the non-mutating operations. The DeleteCollection
method is explicitly patched out since it cannot be correctly
implemented on the storage currently.

As a result, TableConvertor is now exposed.

A few other minor refactorings

* Corrected the case of some variables
* Used functions instead of methods for several helper methods
* Removed the legacy Deleter - service was the only remaining consumer
2018-02-22 23:26:25 -05:00
Kubernetes Submit Queue be87ea1566
Merge pull request #59010 from cheftako/webhook-crd
Automatic merge from submit-queue (batch tested with PRs 59010, 59212, 59281, 59014, 59297). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix flaky AdmissionWebhook e2e-crd tests

**What this PR does / why we need it**: Several of the tests("It") in the e2e suite reuse the CRD.
However they each try to setup and tear down the CRD independently.
Since these tests can be running in parallel, causing intermittant
failures.
Changes the test to set up one shared CRD and reuse.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #58855

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-07 15:27:37 -08:00
Walter Fender 0bdf29801c Fix flaky AdmissionWebhook e2e-crd tests
Several of the tests("It") in the e2e suite reuse the CRD.
However they each try to setup and tear down the CRD independently.
Since these tests can be running in parallel, causing intermittant
failures.
Added a new framework utility for creating CRDs per test.
Then making the relevant tests use the utility to prevent name
collision/race.
Fixed bazel build.
Factored in fixes for @caesarxuchao
Making suggested change for @janetkuo
2018-02-06 11:34:57 -08:00
Kubernetes Submit Queue 9ee71b720e
Merge pull request #59059 from smarterclayton/move_partial_object
Automatic merge from submit-queue (batch tested with PRs 59158, 38320, 59059, 55516, 59357). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote v1alpha1 meta to v1beta1

No code changes, just renames. We can discuss if there are any field / naming changes here or in a follow-up

Parent #58536
Fixes #53224
Prereq to #55637

@kubernetes/sig-api-machinery-pr-reviews @deads2k

```release-note
The `meta.k8s.io/v1alpha1` objects for retrieving tabular responses from the server (`Table`) or fetching just the `ObjectMeta` for an object (as `PartialObjectMetadata`) are now beta as part of `meta.k8s.io/v1beta1`.  Clients may request alternate representations of normal Kubernetes objects by passing an `Accept` header like `application/json;as=Table;g=meta.k8s.io;v=v1beta1` or `application/json;as=PartialObjectMetadata;g=meta.k8s.io;v1=v1beta1`.  Older servers will ignore this representation or return an error if it is not available.  Clients may request fallback to the normal object by adding a non-qualified mime-type to their `Accept` header like `application/json` - the server will then respond with either the alternate representation if it is supported or the fallback mime-type which is the normal object response.
```
2018-02-05 12:40:37 -08:00
Joe Betz f0d04b7131 Update etcd server version to 3.2.13 2018-02-02 17:25:13 -08:00
Clayton Coleman d07a608607 Promote v1alpha1 meta to v1beta1
No code changes, just renames
2018-02-02 14:00:45 -05:00
Walter Fender e4e4979056 Fix flaky AdmissionWebhook e2e tests.
Several of the tests("It") in the e2e suite reuse the config name.
Since these tests can be running in parallel, causing intermittant
failures.
Changes the test so each test uses a different name.
Restructured the tests to make it easier to make sure the name in a
test is being used consistently.
Fix feedback from @caesarxuchao
Fixed format.
2018-01-29 18:14:08 -08:00
Jordan Liggitt b967d1bc80
Wait for healthy extension server before registering APIService 2018-01-23 10:16:33 -05:00
Kubernetes Submit Queue 23226c24d4
Merge pull request #58070 from weekface/weekface/aggregator-proxy-fix
Automatic merge from submit-queue (batch tested with PRs 57896, 58070). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Don't remove APIService from apiHandlerManager when its Available Conditions is not True

**What this PR does / why we need it**:

I use my own apiserver works together with `kube-apiserver`, i have a custom resource: `databases` and created a `database` named: `db-name-1`.

When this apiserver is down(for example: OOMKilled), `kubectl get databases db-name-1 -v 10` returns `404 NotFound`:

```
[{
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource (get databases.core.example.com db-name-1)”,
  "reason": "NotFound",
  "details": {
    "name": “db-name-1”,
    "group": "core.example.com",
    "kind": “databases”,
    "causes": [
      {
        "reason": "UnexpectedServerResponse",
        "message": "404 page not found"
      }
    ]
  },
  "code": 404
}]
```

But it is not really `NotFound`.

So if the APIService is not available, just return 503.

There was a PR related with this: #57943 

**Release note**:


```release-note
kube-apiserver: requests to endpoints handled by unavailable extension API servers (as indicated by an `Available` condition of `false` in the registered APIService) now return `503` errors instead of `404` errors.
```
2018-01-21 20:25:31 -08:00
weekface f06e68a3ab Update unavailable aggregated APIs to 503s instead of 404s 2018-01-21 10:25:03 +08:00
Chao Xu 5029bb56c4 Let mutating webhook defaults the object after applying the patch sent back by the webhook 2018-01-09 15:58:18 -08:00
Lantao Liu 3fd7e3a587 Cleanup api service before namespace deletion. 2017-12-20 22:05:23 +00:00
liz b814c5677f
Collect all the assorted image URLs from e2e tests in one place
utils/image/manifest has an additional `arch` parameter, which determines
whether an image ends in `-$ARCH` (like `-amd64`).

All locations that previously had gcr.io urls referenced in costants or inline
have been updated to refere test/utils/image.
2017-12-19 12:16:07 -05:00
Tim Hockin eba5b6092a Use k8s.gcr.io vanity domain for container images 2017-12-18 09:18:34 -08:00
Kubernetes Submit Queue 88704f3f2d
Merge pull request #57254 from Random-Liu/fix-e2e-test
Automatic merge from submit-queue (batch tested with PRs 55977, 56198, 57202, 57254, 57214). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix e2e test cleanup.

E2E test should use `AfterEach` instead of `AddCleanupAction`.
`CleanupAction` only runs once after all tests finish https://github.com/kubernetes/kubernetes/blob/master/test/e2e/e2e.go#L258.

I hit this issue very frequently that once `Aggregator` test fails, all following tests all fail because the cleanup function does not run after the test, and namespace controller stops working with full of errors:
```
unable to retrieve the complete list of server APIs: wardle.k8s.io/v1alpha1: the server could not find the requested resource
```

Examples:
* https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-cri-containerd-e2e-gci-gce/940
* https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce/19115
* https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce/18763
* https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gce/18751

Signed-off-by: Lantao Liu <lantaol@google.com>

**Release note**:

```release-note
none
```
2017-12-17 08:26:52 -08:00
Kubernetes Submit Queue 439db48b63
Merge pull request #56822 from cheftako/webhookTest
Automatic merge from submit-queue (batch tested with PRs 56676, 57050, 54881, 56822, 57113). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add e2e test for when a webhook does not return.

**What this PR does / why we need it**: Adding an e2e test to simulate a webhook not returning. Making sure this does not just hang the API.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Ref https://github.com/kubernetes/features/issues/492

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-12-16 19:19:46 -08:00