Commit Graph

222 Commits (0207a090743398608b357264ab4c27aeea864abc)

Author SHA1 Message Date
jennybuckley 58b43ad27d Prevent webhooks from affecting admission requests for webhooks 2018-03-05 16:35:52 -08:00
Mike Danese c0b7364563 remove gcloud docker -- since it's deprecated 2018-02-28 00:24:27 -08:00
Ryan Hitchman 8aa3ca3cbb Add a few "+build linux" tags where appropriate. 2018-02-27 13:53:32 -08:00
Kubernetes Submit Queue ecc5eb67d9
Merge pull request #59563 from CaoShuFeng/webhook_readme
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 README for admission webhook test image

This README is copied from somewhere else and it's out of date.

**Release note**:

```release-note
NONE
```
2018-02-21 11:43:06 -08:00
Jeff Grafton ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Cao Shufeng f09f866470 fix README for admission webhook test image
This README is copied from somewhere else and it's out of date.
2018-02-14 09:30:34 +08:00
Paul Czarkowski 2ac136bf07
fix markdown formatting for test image
subtitles were not rendering correctly due to lack of spaces after octothorps.
2018-02-13 14:36:15 -06:00
Di Xu 48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Tim Hockin 3586986416 Switch to k8s.gcr.io vanity domain
This is the 2nd attempt.  The previous was reverted while we figured out
the regional mirrors (oops).

New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest.  To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today).  For now the staging is an alias to
gcr.io/google_containers (the legacy URL).

When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.

We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it.  Nice and
visible, easy to keep track of.
2018-02-07 21:14:19 -08:00
Yang Guo eeecd6e8c0 Update tests to use the hostexec:1.1 image 2018-01-30 17:31:52 -08:00
Yang Guo 5357a31043 e2e test: use sleep to wait in hostexec 2018-01-30 17:30:41 -08:00
Kubernetes Submit Queue 84408378f9
Merge pull request #58174 from filbranden/ipcs1
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>.

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

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

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

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

N/A

**Special notes for your reviewer**:

The core of the matter is to use `ipcs` from util-linux rather than the one from busybox. The typical SELinux policy has enough to allow Docker containers (running under svirt_lxc_net_t SELinux type) to access IPC information by reading the contents of the files under /proc/sysvipc/, but not by using the shmctl etc. syscalls.

The `ipcs` implementation in busybox will use `shmctl(0, SHM_INFO, ...)` to detect whether it can read IPC info (see source code [here](https://git.busybox.net/busybox/tree/util-linux/ipcs.c?h=1_28_0#n138)), while the one in util-linux will prefer to read from the /proc files directly if they are available (see source code [here](https://github.com/karelzak/util-linux/blob/v2.27.1/sys-utils/ipcutils.c#L108)).

It turns out the SELinux policy doesn't allow the shmctl syscalls in an unprivileged container, while access to it through the /proc interface is fine. (One could argue this is a bug in the SELinux policy, but getting it fixed on stable OSs is hard, and it's not that hard for us to test it with an util-linux `ipcs`, so I propose we do so.)

This PR also contains a refactor of the code setting IpcMode, since setting it in the "common options" function is misleading, as on containers other than the sandbox, it ends up always getting overwritten, so let's only set it to "host" in the Sandbox.

It also has a minor fix for the `ipcmk` call, since support for size suffix was only introduced in recent versions of it.

**Release note**:

```release-note
NONE
```
2018-01-30 17:18:52 -08:00
Jeff Grafton c555a7f3c9 Update to go1.9.3 2018-01-29 18:26:59 -08:00
Cao Shufeng 1df5373d6a fix webhook admission README 2018-01-28 14:25:41 +08:00
Filipe Brandenburger c9e5bfbbbb Add new e2e-test container to export ipcs from util-linux
This container will be used to exercise the HostIPC functionality in
e2e-node tests.

The version of `ipcs` shipped in busybox performs operations that get
blocked by SELinux on hosts where it is enabled. The version of `ipcs`
in util-linux does not perform those operations, rather it checks
whether the /proc files it needs are available and proceeds to reading
from them directly.

Using `ipcs` from util-linux makes these tests pass, even when running
under SELinux enabled, so let's use them here.

Tested: On a host where Docker with SELinux enabled:

- Checked that `ipcs` from busybox does not work:

  $ docker run busybox ipcs -m
  kernel not configured for shared memory

- Checked that the one from this container does work:

  $ docker run gcr.io/kubernetes-e2e-test-images/ipc-utils-amd64:1.0 ipcs -m
  ------ Shared Memory Segments --------
  key        shmid      owner      perms      bytes      nattch     status
2018-01-25 11:09:16 -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
Manjunath A Kumatagi b0aff1ebea Add owners file for test images 2017-12-26 20:44:45 +05:30
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Tim Hockin e9dd8a68f6 Revert k8s.gcr.io vanity domain
This reverts commit eba5b6092a.

Fixes https://github.com/kubernetes/kubernetes/issues/57526
2017-12-22 14:36:16 -08:00
Tim Hockin f7be352a67 gcloud docker now auths k8s.gcr.io by default 2017-12-18 09:18:34 -08:00
Tim Hockin eba5b6092a Use k8s.gcr.io vanity domain for container images 2017-12-18 09:18:34 -08:00
Walter Fender e1cf77858e Add e2e test for when a webhook does not return.
Adding code to simulate a webhook not returning.
Ensure that we verify that the returned error is a timeout.
2017-12-11 18:32:31 -08:00
Kubernetes Submit Queue f9f8dc30c5
Merge pull request #52748 from leblancd/v6_e2e_host_port
Automatic merge from submit-queue (batch tested with PRs 52748, 56623). 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 brackets around IPv6 addrs in e2e test IP:port endpoints

There are several locations in the e2e tests where endpoints of the
form IPv6:port use IPv6 addresses directly, without surrounding brackets.
Brackets are required around IPv6 addresses in this case, in order to
distinguish the colons in the IPv6 address from the colon immediately
preceding the port.

Also, wherever the curl command might be used with an IPv6 address
surrounded in brackets, the "-g" argument is added to the curl
command line arguments so that the brackets can be interpreted
correctly.

fixes #52746



**What this PR does / why we need it**:
This PR adds brackets around IPv6 addresses when they appear as part of an IPv6-addr:port endpoint
in the e2e tests. This is needed because any connections that attempt to use IPv6-addr:port
endpoint without brackets surrounding the IPv6-addr will fail.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-04 14:22:10 -08:00
Chao Xu fcf4f15c89 update-all generated 2017-11-21 13:00:40 -08:00
Chao Xu 7945ae68d0 remove reference to v1alpha1 2017-11-21 13:00:40 -08:00
Chao Xu 6193360eb5 generated bazel 2017-11-17 21:02:47 -08:00
Chao Xu ea123f82aa Adding the mutating webhook 2017-11-17 21:02:47 -08:00
Kubernetes Submit Queue 2aaab817de
Merge pull request #55420 from cblecker/go1.9.2
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>.

Upgrade to go1.9.2

**What this PR does / why we need it**:
Use go1.9.2, containing a number of bug fixes: https://github.com/golang/go/issues?q=milestone%3AGo1.9.2

**Release note**:
```release-note
Upgrade to go1.9.2
```
2017-11-17 20:24:42 -08:00
Christoph Blecker 82737e730c
Upgrade to go1.9.2 2017-11-17 16:27:17 -08:00
cheftako dac3c2e168 Admission request/response handling
AdmissionResponse allows mutating webhook to send apiserver a json patch
to mutate the object.
This reflects the imperative nature of AdmissionReview. It adds
AdmissionRequest and AdmissionResponse in place of status/spec.
The AdmissionResponse the allows the mutating webhook
to send back a json path with the mutated version of the requested
object.
Fixed the integration test to clean up properly.
Switched test image to 1.8v5 to reflect API changes.
Make sure to cache test framework client for cleaup test code.
Switched to pointer for patch type.
Factored in @liggitt's feedback.
Factored in @lavalamp's feedback.
2017-11-17 14:22:55 -08:00
Dane LeBlanc 2827b7ffb7 Add brackets around IPv6 addrs in e2e test IP:port endpoints
There are several locations in the e2e tests where endpoints of the
form IP:port use IPv6 addresses directly, without surrounding brackets.
Brackets are required around IPv6 addresses in this case, in order to
distinguish the colons in the IPv6 address from the colon immediately
preceding the port.

Also, wherever the curl command might be used with an IPv6 address
surrounded in brackets, the "-g" argument is added to the curl
command line arguments so that the brackets can be interpreted
correctly.

fixes #52746
2017-11-14 10:55:09 -05:00
Chao Xu ab053a224d let validation webhook convert objects to the external version before sending them 2017-11-13 12:55:33 -08:00
Kubernetes Submit Queue e52e79342c
Merge pull request #54727 from caesarxuchao/namespaceSelector
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>.

Add namespace selector to admission webhook

Implementing the [design](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/admission-webhook-bootstrapping.md).

* Added the NamespaceSelector field to the webhook configuration API
* Let the webhook plugin respect the NamespaceSelector
* Added unit test and e2e test

cc @kubernetes/sig-api-machinery-api-reviews 

```release-note
Added namespaceSelector to externalAdmissionWebhook configuration to allow applying webhooks only to objects in the namespaces that have matching labels.
```
2017-11-11 07:50:32 -08:00
Chao Xu 7006d224be add NamespaceSelector to the api
business logic in webhook plugin and unit test

add a e2e test for namespace selector
2017-11-10 13:40:16 -08:00
Ryan Phillips 66965daf56 bump base images to debian stretch 2017-11-10 09:54:10 -06:00
Chao Xu 7430e0a489 remove the wrongly checked in binary 2017-11-05 15:52:16 -08:00
Chao Xu 0f54fdb059 update bazel 2017-10-27 15:58:24 -07:00
Chao Xu 1b420e4f80 webhook source code 2017-10-27 15:58:24 -07:00
Kubernetes Submit Queue 06776c2ab3 Merge pull request #54327 from freehan/hostname
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>.

Modify serve-hostname image to handle graceful termination

```release-note
NONE
```
2017-10-24 22:24:53 -07:00
Minhan Xia dd7ad4b738 Modify serve-hostname image to handle graceful termination 2017-10-23 14:09:32 -07:00
Jack Danger fb46207670 Directly using std{in,out} for test helper subproc
This addresses a TODO in a test helper. This is a very minor
improvement.
2017-10-19 13:25:28 -07:00
Christoph Blecker 5c026f6317
Upgrade to go1.9 2017-10-16 10:39:31 -07:00
Jeff Grafton aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jeff Grafton f1953c4f53 bazel: use autogenerated all-srcs rules instead of manually-curated sources rules 2017-09-21 15:53:23 -07:00
Jeff Grafton 02fb4200dc Use buildozer to delete licenses() rules 2017-09-21 15:53:22 -07:00
Jeff Grafton 532bd482df Use buildozer to remove deprecated automanaged tags 2017-09-21 15:53:22 -07:00
Kubernetes Submit Queue 0103ed33d3 Merge pull request #48552 from mkumatag/pets
Automatic merge from submit-queue

Multiarch support for pets images

**What this PR does / why we need it**:
This PR is for multiarch support for pets image

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

**Special notes for your reviewer**:
Copied over the `contrib/pets/peer-finder` as this one is heavily used in many docker images under `test/images`. After this PR I'll submit the PR in contrib project to remove it.

**Release note**:

```NONE
```
2017-09-07 22:27:20 -07:00
Manjunath A Kumatagi 33b0702edc Multiarch support for pets images 2017-09-07 22:30:41 +05:30
Kubernetes Submit Queue 6b9ce5ba11 Merge pull request #50597 from dixudx/qemu_upgrade_2.9.1
Automatic merge from submit-queue

bump QEMU version to v2.9.1

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

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
xref #38067

**Special notes for your reviewer**:
/assign @luxas 

**Release note**:

```release-note
update QEMU version to v2.9.1
```
2017-09-03 03:24:53 -07:00
Di Xu ec2fbbc85d bump new version due to base image changed 2017-08-21 14:51:44 +08:00