Commit Graph

1141 Commits

Author SHA1 Message Date
Davanum Srinivas 7857c79c99 Update Gophercloud dependency for reauth problem
Fixes picked up from gophercloud are:
443743e883...0b6b13c4dd

Including the one for endless loop on reauth:
https://github.com/gophercloud/gophercloud/pull/604

Kubernetes-commit: 4366454fbe4a788c6f52e6c0b9f5cb72e9db0784
2017-11-13 22:16:20 -05:00
Clayton Coleman ce019febe3 Move unstructured conversion into pkg/runtime
Scheme conversion should support unstructured conversion natively to
allow going from unstructured to typed and back. It is not a higher
level responsibility to do that conversion because the scheme is the
only one who knows what types it supports.

Kubernetes-commit: 557f9ddfe6300ecdbdd70ea67dca63bf6b710ea7
2017-11-13 21:28:57 -05:00
Joe Betz 3773a59cf0 Remove is_system_ns from admission metrics
Kubernetes-commit: 375e2d03ab8c70c8c84676a7eee8b46646036bde
2017-11-13 12:34:36 -08:00
Dr. Stefan Schimanski 29de1cdd6d registry: move generic registry tester into k8s.io/apiserver
Kubernetes-commit: 0b100cb69b9f99445aa523cf9c4abae8f62c751a
2017-11-13 18:07:35 +01:00
Kubernetes Publisher 7e9a5ecb20 Merge pull request #55534 from lavalamp/wh-api-fixes
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>.

Tighten webhook client config validation

ref https://github.com/kubernetes/features/issues/492

Fix up some nits left from #54889.

```release-note
NONE
```

Kubernetes-commit: 2db28383e1151e5d442b81eb73a02b3cf144615c
2017-11-12 06:04:50 -08:00
Kubernetes Publisher 916c93f31b Merge pull request #54889 from lavalamp/wh-api
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 webhook API to also support URLs

ref: https://github.com/kubernetes/features/issues/492

```release-note
The dynamic admission webhook now supports a URL in addition to a service reference, to accommodate out-of-cluster webhooks.
```

Kubernetes-commit: e93819049db49694718bc9c96e67050d366c6f63
2017-11-11 23:01:39 -08:00
Daniel Smith bee24b37a5 fix docs and validation
Kubernetes-commit: e73fd8784484235d5010f4b2bba2251a584c5dd0
2017-11-11 18:00:32 -08:00
Kubernetes Publisher 05fa8296ad 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.
```

Kubernetes-commit: e52e79342c610def76885b751c6533079f7bc17b
2017-11-11 07:50:32 -08:00
Kubernetes Publisher 787d96557a Merge pull request #55396 from sttts/sttts-drop-deepcopy-registration
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>.

deepcopy: remove unused deepcopy func registration

Counterpart to https://github.com/kubernetes/gengo/pull/67.

Kubernetes-commit: 7c8596a95fb37e3c1318e25ae505989122bd4e56
2017-12-07 04:31:51 +00:00
Kubernetes Publisher 8589af33d5 Merge pull request #54861 from hzxuzhonghu/admission-webhook
Automatic merge from submit-queue (batch tested with PRs 53047, 54861, 55413, 55395, 55308). 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>.

cache admission webhook restClient

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

**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 #54860

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 331c52c0fd4890ce999bad29265600d16cbb7abd
2017-12-07 04:31:50 +00:00
Kubernetes Publisher de3e410497 Merge pull request #55291 from hzxuzhonghu/admission-initializer
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 redundant code in admission initializer

**What this PR does / why we need it**:
remove unused return error in `k8s.io\kubernetes\staging\src\k8s.io\apiserver\pkg\admission\initializer\initializer.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
```

Kubernetes-commit: a43c6e41d58efff5308120f74eac339eb631e9bc
2017-12-07 04:31:49 +00:00
Kubernetes Publisher 101bfbcd85 Merge pull request #54849 from hzxuzhonghu/audit-graceful-shutdown
Automatic merge from submit-queue (batch tested with PRs 46581, 55426, 54849). 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>.

apiserver shutdown gracefully

**What this PR does / why we need it**:
apiserver shutdown gracefully and wait all non-long running requests finish before process exit.

**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 #54793

**Special notes for your reviewer**:
remove waitGroup, use atomic to count.
**Release note**:

```release-note
NONE
```

Kubernetes-commit: d12d711ba67af9c63c6497a3d73357729a76e9ab
2017-12-07 04:31:49 +00:00
Kubernetes Publisher d2374206e6 Merge pull request #55282 from mbohlool/webhooks
Automatic merge from submit-queue (batch tested with PRs 55268, 55282, 55419, 48340, 54829). 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 MutatingWebhookConfiguration type

As part of Mutating Webhook support, this PR adds the configuration for Mutating webhooks. It also renames existing ReadOnly webhook configurations from ExternalAdmissionHookConfiguration to ValidatingWebhookConfiguration. As part of the process some sub-types are also renamed.

Lastly, the mutating webhook configurations are sorted by name to make the serial executing of them deterministic.

ref: https://github.com/kubernetes/features/issues/492

Kubernetes-commit: 61f210859d9c4bd64af254ba696f6f693596ced9
2017-12-07 04:31:24 +00:00
Chao Xu 640cf74d8c generated
Kubernetes-commit: 2f83748068e45fd548b1caaac2cc0ca06a769653
2017-11-10 11:06:07 -08:00
hzxuzhonghu bc64759ab8 rename test file and remove unused code
Kubernetes-commit: 4685bd8f3b270fdeb4cfe4a252b3cb3ab308ac75
2017-11-10 15:11:44 +08:00
Saad Ali 618eb972ad Generated files for new VolumeAttachemnt object
Kubernetes-commit: 9f294c1ad041e3cebd2d29a3afd42d00796c4f55
2017-11-09 21:56:38 -08:00
hzxuzhonghu c79bc73664 verify token file
Kubernetes-commit: 62c170fc1da2a94cd4dacd56f8f798f491b29ae1
2017-11-10 11:30:51 +08:00
Kubernetes Publisher b38d0e710e Merge pull request #53651 from sttts/sttts-apis-core
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>.

Move core API to pkg/apis/core

Fixes https://github.com/kubernetes/kubernetes/issues/55304.

This moves the types in pkg/api and most of pkg/api/v1 to pkg/apis/core to match the other api groups, following-up on what https://github.com/kubernetes/kubernetes/pull/44784 did for the external types.

It's a nearly 100% mechanical package move with a number of trivial fixups in code-generators and in tests which do string comparisons of types via reflection.

**Most importantly:**

- group names are unchanged
- apimachinery semantics are unchanged
- the outside api is unchanged.

Note that some packages for helpers are left in pkg/api/v1. Splitting them into helpers which belong tightly to the api and those which are not is left to follow-ups.

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

Kubernetes-commit: dd9981d038012c120525c9e6df98b3beb3ef19e1
2017-11-09 06:13:39 -08:00
Kubernetes Publisher b78f8f90fd Merge pull request #54267 from ericchiang/audit-policy-file-without-kind-or-version
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>.

audit policy: reject audit policy files without apiVersion and kind

Closes https://github.com/kubernetes/kubernetes/issues/54254

/cc @sttts @CaoShuFeng @crassirostris @tallclair

/sig auth
/kind cleanup

```release-note
Audit policy files without apiVersion and kind are treated as invalid.
```

Kubernetes-commit: ab44ec9d7702e973f01ef716c06c8aa69441813c
2017-12-07 04:31:22 +00:00
Kubernetes Publisher bda330def2 Merge pull request #49763 from supereagle/versioned-group-clients
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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>.

use versiond group clients from client-go

**What this PR does / why we need it**:
Some **Deprecated** group clients are still used, replace them with versioned group clients.

**Which issue this PR fixes**: fixes #49760

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

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

Kubernetes-commit: a701a42a82da8c3dec18cb35124ee9038c91cca6
2017-12-07 04:31:21 +00:00
Kubernetes Publisher 3de687847b Merge pull request #55228 from sttts/sttts-validation-admission-tests
Automatic merge from submit-queue (batch tested with PRs 55331, 55272, 55228, 49763, 55242). 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>.

apiserver: add validating admission tests

Follow-up of https://github.com/kubernetes/kubernetes/pull/54484

This includes tests
- in endpoint tests,
- in generic registry,
- in patch handler,
- in admission chain.

Kubernetes-commit: ee7f1b6e74fab4ed77592f29264575c634e4f2c1
2017-12-07 04:31:21 +00:00
Kubernetes Publisher 126b0eccc3 Merge pull request #54780 from CaoShuFeng/patch-twice
Automatic merge from submit-queue (batch tested with PRs 54493, 52501, 55172, 54780, 54819). 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>.

partial fix crd patch failing

partial fix https://github.com/kubernetes/kubernetes/issues/53379

**Release note**:
```
NONE
```

Kubernetes-commit: 255a1be780448c07f8e3397caef8faa11ddfc027
2017-12-07 04:31:20 +00:00
Kubernetes Publisher 9a82dd46b2 Merge pull request #55175 from sttts/sttts-lock-registry-cleanup
Automatic merge from submit-queue (batch tested with PRs 53592, 52562, 55175, 55213). 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>.

apiserver: protect registry cleanup against concurrent access

The mechanism uses global state during testing. Better protect it and fail early when a race is happening.

Related to https://github.com/kubernetes/kubernetes/issues/54095

Kubernetes-commit: 47d1973c18e278621b8843ab9d18f8eb348d224c
2017-12-07 04:31:20 +00:00
Kubernetes Publisher 2bdf465dd6 Merge pull request #53273 from mikedanese/authtristate
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 support for short-circuit deny in union authorizer

This change has no behavioral changes.

Fixes https://github.com/kubernetes/kubernetes/issues/51862

```release-note
Add support for the webhook authorizer to make a Deny decision that short-circuits the union authorizer and immediately returns Deny.
```

Kubernetes-commit: d33077526af1e22c4d7124836a987ce108c1533b
2017-12-07 04:31:19 +00:00
Kubernetes Publisher 98daf58abc Merge pull request #55157 from sttts/sttts-etcd3-scheme
Automatic merge from submit-queue (batch tested with PRs 55061, 55157, 55231). 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>.

apiserver: remove scheme arg from NewUnsecuredEtcd3TestClientServer

Not necessary anymore.

Kubernetes-commit: eb578813cba0e835c1079c5b1b570c16e8a3dd47
2017-12-07 04:31:18 +00:00
Kubernetes Publisher 0a8a7c7bce Merge pull request #54786 from shiywang/bump-protobuf
Automatic merge from submit-queue (batch tested with PRs 55093, 54966, 55047, 54971, 54786). 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>.

vendor update: github.com/golang/protobuf

When I'm working on PR: https://github.com/kubernetes/kubernetes/pull/54782, I met a problem here: https://github.com/golang/protobuf/issues/372, which I think we need to update our vendor of protobuf
and I ask Dr. Stefan for suggestion, here is our coversation

shiywang [5:09 PM]
hi, Dr. Stefan i'm sorry to bother, I have a simple question, I was working on a pr which need to use protobuf custom field, and I run into this problem here: https://github.com/golang/protobuf/issues/372  which I think is due to our codebase's protobuf vendor is too old `vendor/github.com/golang/protobuf`,  do you think I can update that vendor to lastest one ?  also I noticed there's also an extend package called `vendor/github.com/gogo/protobuf/proto` what's the releationship between those two ?  which one should I update ?

sttts
[5:11 PM]
hi

[5:11]
don't know much about the proto internals either, @claytonc is probably the only one

[5:12]
create a vendor/github.com/golang/protobuf bump PR and assign it to him

shiywang [5:12 PM]
sounds good, thank you sir

so
/assign @smarterclayton
for suggestion, thanks

```release-note
NONE
```

Kubernetes-commit: 5b7ce60fcebea445b7852d8dc2bce141a2bd7a3a
2017-12-07 04:31:18 +00:00
Dr. Stefan Schimanski 563bb7b931 Update generated code
Kubernetes-commit: 1e79dfb959896f2e51be87ecef491452bd17724c
2017-11-09 12:27:20 +01:00
Dr. Stefan Schimanski a32fcea8bb deepcopy: remove deepcopy register tags
Kubernetes-commit: 72809a08b94650bc8988db37be3a2ee4c6ccd113
2017-11-09 12:40:14 +01:00
Dr. Stefan Schimanski fa51e5900d apimachinery: Remove cloner from scheme
Kubernetes-commit: b5b62c68318be79a665257c260ea9f9bbb6d6318
2017-11-09 12:27:06 +01:00
Joe Betz f3058e0b10 Fix admission metrics to track mutating/validating correctly
Also update admission test mocks to better reflect typical usage and fix broken tests.

Kubernetes-commit: 2643c6ae3e7b7bc09e1d3eb695a438b190123083
2017-11-08 17:26:31 -08:00
Dr. Stefan Schimanski d10f10b8ac pkg/apis/core: mechanical import fixes in dependencies
Kubernetes-commit: 012b085ac870d359131f4251213bf2fff1d15aa0
2017-11-08 23:34:54 +01:00
hzxuzhonghu 2d197ca9f2 fix typo and adjust import sequence
Kubernetes-commit: 185d5c1f3debec7f7c81cd713307134103038497
2017-11-08 11:43:56 +08:00
hzxuzhonghu c37db061da remove redundant code in admission initializer
Kubernetes-commit: 9d1e6d3e2cc25db8e07db446d00390059c8264f8
2017-11-08 10:54:06 +08:00
mbohlool db766abbf7 Update generated files for MutatingWebhookConfiguration
Kubernetes-commit: 4568e0530c53df81d1bbd5e700daca041a1d8439
2017-11-07 17:29:01 -08:00
mbohlool 2aa55c4d47 Add MutatingWebhookConfiguration type
Kubernetes-commit: fc5a613c17c81fdda54158d58a19bd6089ae9882
2017-11-07 12:49:19 -08:00
mbohlool e57a4d504d Update generated files
Kubernetes-commit: cb43840492b383f4e1b87d7108d51c6439e1dad5
2017-11-07 12:42:06 -08:00
mbohlool 3846cb803e Rename ExternalAdmissionHookConfiguration to ValidatingWebhookConfiguration
Kubernetes-commit: 9ddea83a2ce0937cf0fc8f8c35614bb18e74cfad
2017-11-07 12:46:54 -08:00
Michael Taufen 8d690cc5cb ColonSeparatedMultimapStringString: allow multiple Set invocations with default override
The first call to Set will clear the map before adding entries;
subsequent calls will simply append to the map.
This makes it possible to override default values with a command-line
option rather than appending to defaults,
while still allowing the distribution of key-value pairs across
multiple flag invocations.

For example: `--flag "a:hello" --flag "b:again" --flag "b:beautiful"
--flag "c:world"` results in `{"a": ["hello"], "b": ["again",
"beautiful"], "c": ["world"]}`

Kubernetes-commit: 6e49ac382bbd43e5a3f648607f8005bdf0237317
2017-11-07 09:15:26 -08:00
Dr. Stefan Schimanski 204da0b2db apiserver: add validating admission tests
- in endpoint tests
- in generic registry
- in patch handler
- in admission chain

Kubernetes-commit: c558d2a3517fafdb704edd2c00b6df6738786959
2017-11-07 10:40:43 +01:00
Joe Betz a1e35e7bfe Add system namespaces to admission metrics. Add tests and leverage test code from PR#55086
Kubernetes-commit: 9d13d1baece20fc611176aad3b6f39ccf9fa4b36
2017-11-06 17:48:59 -08:00
cheftako 556a83dbf9 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.

Kubernetes-commit: dac3c2e168784bbcf1cbfef8bf5430101e191715
2017-11-06 15:41:26 -08:00
Kubernetes Publisher f260745b82 Merge pull request #54734 from janetkuo/webhook-error
Automatic merge from submit-queue (batch tested with PRs 53645, 54734, 54586, 55015, 54688). 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>.

Improve webhook error message

**What this PR does / why we need it**:
Currently, apiserver only prints message of review status returned by a rejecting webhook controller. If the message is empty, users will see this in event message: 
`create Pod <pod-name> failed error:<empty-string>`. Hook name should be included in the error message as well.

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

**Special notes for your reviewer**: @kubernetes/sig-api-machinery-bugs 

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 3625a32d449b32ee5f9f32738ea06ddaf95cbccc
2017-11-06 15:33:37 -08:00
Kubernetes Publisher baff305a6c Merge pull request #55169 from sttts/sttts-cache-stop-race
Automatic merge from submit-queue (batch tested with PRs 55169, 54990). 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>.

apiserver: fix Cacher.Stop() race

Kubernetes-commit: 7966af637ed34b40e73b9a3c361a614e9ce3fc86
2017-12-07 04:30:52 +00:00
Kubernetes Publisher d5c7d449a9 Merge pull request #55115 from CaoShuFeng/crd_test
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>.

[trival]remove duplicated code from unit test

**Release note**:
```
NONE
```

Kubernetes-commit: 462d5ed1067d14f68c4bdaeb9469c37eab0172ea
2017-12-07 04:30:51 +00:00
Kubernetes Publisher 656d3dafc2 Merge pull request #55052 from hzxuzhonghu/admission-handler
Automatic merge from submit-queue (batch tested with PRs 51401, 54056, 54977, 55017, 55052). 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>.

refactor admission handler and add UT

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

remove Redundant code, and add UT case.

**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

```

Kubernetes-commit: 85a6ec7b610454d046589ed0610209b832188e42
2017-12-07 04:30:50 +00:00
Kubernetes Publisher 37dd570a2f Merge pull request #54643 from mtaufen/structure-manifest-url-header
Automatic merge from submit-queue (batch tested with PRs 52367, 53363, 54989, 54872, 54643). 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>.

Lift embedded structure out of ManifestURLHeader field

Related: #53833

```release-note
It is now possible to set multiple manifest url headers via the Kubelet's --manifest-url-header flag. Multiple headers for the same key will be added in the order provided. The ManifestURLHeader field in KubeletConfiguration object (kubeletconfig/v1alpha1) is now a map[string][]string, which facilitates writing JSON and YAML files.
```

Kubernetes-commit: 3a15fdbe7e1ceefa59d7cc41ac6d65998cef1b1a
2017-12-07 04:30:50 +00:00
Kubernetes Publisher 703a17eb2a Merge pull request #54957 from apelisse/update-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 55004, 54957). 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>.

Update kube-openapi to use validation

**What this PR does / why we need it**: Moves openapi validation code to kube-openapi, so that we can move the rest of the code to apimachinery repository, so that later we can use it from both the client and the server.

**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 #Nothing

**Special notes for your reviewer**:

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

Kubernetes-commit: 55e216f56eac0082acc6be655d9ae09cf9ba38a8
2017-12-07 04:30:49 +00:00
Kubernetes Publisher c9df2bdd6c Merge pull request #54484 from sttts/sttts-split-psp
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>.

admission: wire through validating-only admission

Based on https://github.com/kubernetes/kubernetes/pull/54232.

This is important and required for beta because it affects the shape of the webhook admission plugins that are going to be produced and is needed to make sure that our existing chain continues to properly verify and protect the API objects based on their final state after webhook admission mutators run.

We discussed this in the October 11 API machinery call with @erictune and @caesarxuchao and we agreed to do this as a requirement for beta. See this part of the recording: https://www.youtube.com/watch?v=mrgDPHyr4VY#t=325 .

Kubernetes-commit: 40212c17cdf4d7bc2a45c495cf0d37ebab032578
2017-12-07 04:30:17 +00:00
Kubernetes Publisher 375f5ba17b Merge pull request #53558 from nikhita/cr-strategic-merge-patch
Automatic merge from submit-queue (batch tested with PRs 54800, 53898, 54812, 54921, 53558). 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 error for strategic merge patch of custom resources

Fixes #50037.

We need the go struct tags `patchMergeKey` and `patchStrategy` for fields that support a strategic merge patch. For native resources, we can easily figure out these tags since we know the fields.

Because custom resources are decoded as Unstructured and because we're missing the metadata about how to handle each field in a strategic merge patch, we can't find the go struct tags. Hence, we can't easily  do a strategic merge for custom resources.

So we should fail fast and return an error.

**Release note**:

```release-note
NONE
```

/cc @sttts @deads2k @ncdc

Kubernetes-commit: 7aed66305127904a874289a1c78f5b5d5ad6b80c
2017-12-07 04:30:16 +00:00
Kubernetes Publisher 4590a3380f Merge pull request #53048 from kubermatic/log-healthz-check-fail
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>.

Log error when a healthz check fails

**What this PR does / why we need it**:
Currently we only tell a user that a healthz check failed but we don't display the explicit error of the failed check. This is fine, but we should log the error to make debugging easier.

```release-note
Log error of failed healthz check
```

Kubernetes-commit: 816f2f460531cc1b2ed999962b64f930a7fc39fd
2017-12-07 04:30:15 +00:00