Commit Graph

365 Commits (fbc94c089657045217999995aaf08e4025b53c52)

Author SHA1 Message Date
Kubernetes Submit Queue 01c45f7de1 Merge pull request #41085 from deads2k/apiserver-07-move-runtime-config
Automatic merge from submit-queue (batch tested with PRs 41061, 40888, 40664, 41020, 41085)

move --runtime-config to kubeapiserver

`--runtime-config` is only useful if you have a lot of API groups in one server.  If you have a single API group in your server (the vast majority of aggregated API servers), then the flag is unneeded and relatively complex.  This moves it to closer to point of use.

@sttts
2017-02-07 23:06:43 -08:00
Kubernetes Submit Queue bc60def8a8 Merge pull request #40664 from smarterclayton/etcd_data_wrapper
Automatic merge from submit-queue (batch tested with PRs 41061, 40888, 40664, 41020, 41085)

Allow values to be wrapped prior to serialization in etcd

This adds a new value transformer to the etcd2 store that can transform
the value from etcd on read and write. This will allow the store to
implement encryption at rest or otherwise transform the value prior to
persistence.

* [x] etcd3 store
* [x] example of transformation
* [x] partial error handling

This is in support of #12742
2017-02-07 23:06:40 -08:00
Janet Kuo 51c7570ae1 Fix incorrect error message in watch.Until 2017-02-07 16:51:35 -08:00
deads2k b410b387ee move storage serialization type to etcd options 2017-02-07 13:56:19 -05:00
deads2k cc75d51897 add feature enablement options to recommendedoptions 2017-02-07 13:56:19 -05:00
deads2k 226af4adc4 move --runtime-config to kubeapiserver 2017-02-07 13:43:13 -05:00
deads2k 51b5d5a51b move auditoptions to separate struct 2017-02-07 13:03:08 -05:00
deads2k cfbdbb4450 add recommended aggregated api server options 2017-02-07 12:55:39 -05:00
Kubernetes Submit Queue 42973b0523 Merge pull request #40947 from deads2k/apiserver-04-invert
Automatic merge from submit-queue (batch tested with PRs 41023, 41031, 40947)

apiserver command line options lead to config

Logically command line options lead to config, not the other way around.  We're clean enough now we can actually do the inversion.

WIP because I have some test cycles to fix, but this is all the meat.

@kubernetes/sig-api-machinery-misc
2017-02-07 09:04:41 -08:00
Kubernetes Submit Queue 03db7eac03 Merge pull request #41023 from deads2k/apiserver-05-config-move
Automatic merge from submit-queue (batch tested with PRs 41023, 41031, 40947)

move admission read logic to apiserver

Promised followup to https://github.com/kubernetes/kubernetes/pull/40943

@sttts @kubernetes/sig-api-machinery-misc
2017-02-07 09:04:38 -08:00
Kubernetes Submit Queue 3f6dd889f3 Merge pull request #40985 from p0lyn0mial/add_shortnames_to_discovery_api
Automatic merge from submit-queue (batch tested with PRs 40980, 40985)

added short names for resources which are exposed during discovery

**What this PR does / why we need it**:
The changes add short names for resources. The short names will be delivered to kubectl during discovery.
2017-02-07 06:21:10 -08:00
deads2k 250408ee9c apiserver command line options lead to config 2017-02-07 07:57:11 -05:00
deads2k 58992ce8d2 move admission read logic 2017-02-07 07:44:14 -05:00
Wojciech Tyczynski 8985c6ba4f Fix incorrect watch cache sizes 2017-02-07 09:44:31 +01:00
Kubernetes Submit Queue 821e171247 Merge pull request #35950 from nikhiljindal/nsdelreuse
Automatic merge from submit-queue

federation: Refactoring namespaced resources deletion code from kube ns controller and sharing it with fed ns controller

Ref https://github.com/kubernetes/kubernetes/issues/33612

Refactoring code in kube namespace controller to delete all resources in a namespace when the namespace is deleted. Refactored this code into a separate NamespacedResourcesDeleter class and calling it from federation namespace controller.
This is required for enabling cascading deletion of namespaced resources in federation apiserver.
Before this PR, we were directly deleting the namespaced resources and assuming that they go away immediately. With cascading deletion, we will have to wait for the corresponding controllers to first delete the resources from underlying clusters and then delete the resource from federation control plane. NamespacedResourcesDeleter has this waiting logic.

cc @kubernetes/sig-federation-misc @caesarxuchao @derekwaynecarr @mwielgus
2017-02-06 18:10:58 -08:00
p0lyn0mial b2cce0ac8e added short names for resources which are exposed during discovery 2017-02-06 23:35:07 +01:00
Kubernetes Submit Queue 44a3cd123f Merge pull request #40930 from deads2k/kubectl-01-negotiation
Automatic merge from submit-queue (batch tested with PRs 40930, 40951)

update negotiation to reflect current kubectl state

Very few things actually require negotiation, but the client-cache attempts it all the time.  If you've explicitly requested one, you still fail.  If you haven't requested one and the server doesn't have one, you still get the client behavior.  After this, if you haven't requested one and the client and server don't have one, you simply get an empty you can interpret how you choose.

@lavalamp without this, you're unable to use `kubectl` against arbitrary servers.
2017-02-06 14:27:04 -08:00
Kubernetes Submit Queue b87adb21b1 Merge pull request #40943 from deads2k/apiserver-01-admission-types
Automatic merge from submit-queue (batch tested with PRs 40943, 40967)

switch admission serialized config to an apiserver type

Switches the kube admission config from componentconfig to the new `apiserver.k8s.io` group so that all API servers can use the shared configuration.  This switch external serialization, but it does not move the code that reads the config.  I'd like to do that as a follow-on.

@kubernetes/sig-api-machinery-misc @kubernetes/api-reviewers @smarterclayton 
@derekwaynecarr ptal
@sttts
2017-02-06 12:22:54 -08:00
nikhiljindal 74676f6995 Updating federation namespace controller to share namespaced resources deletion code with kube namespace controller 2017-02-06 10:50:40 -08:00
deads2k 75841dc4f1 switch admission serialized config to an apiserver type 2017-02-06 11:38:08 -05:00
deads2k ce86ef5518 add apiserver API group for structured configuration 2017-02-06 11:22:45 -05:00
Wojciech Tyczynski f616f06764 Revert "Avoid unnecessary copies in cacher" 2017-02-06 16:50:44 +01:00
Kubernetes Submit Queue 6f37347fce Merge pull request #40931 from deads2k/owners-05-liggitt
Automatic merge from submit-queue

add liggitt to apimachinery/apiserver packages

Add @liggitt to apimachinery and apiserver packages.
2017-02-06 06:45:26 -08:00
Clayton Coleman bc4b50640b
Allow ValueTransformer to indicate resource is stale
Allows a transformer (such as an encrypter) to force an update if a new
key is in use, thus allowing simple writes to the REST layer to
trivially migrate keys.
2017-02-05 22:47:30 -05:00
Clayton Coleman 4313bc6df3
Allow values to be wrapped prior to serialization in etcd3 2017-02-05 22:47:29 -05:00
Clayton Coleman 36df93826a
Allow values to be wrapped prior to serialization in etcd2
This adds a new value transformer to the etcd2 store that can transform
the value from etcd on read and write. This will allow the store to
implement encryption at rest or otherwise transform the value prior to
persistence.
2017-02-05 22:47:29 -05:00
Klaus Ma cc26fe6ee9 Removed unnecessarly empty line. 2017-02-06 11:10:34 +08:00
Kubernetes Submit Queue 2541c16692 Merge pull request #40942 from ymqytw/extract_util_from_SMPatch
Automatic merge from submit-queue (batch tested with PRs 40289, 40877, 40879, 39972, 40942)

Extract util used by jsonmergepatch and SMPatch

followup  https://github.com/kubernetes/kubernetes/pull/40666#discussion_r99198931

Extract some util out of the `strategicMergePatch` to make `jsonMergePatch` doesn't depend on `strategicMergePatch`.

```release-note
None
```

cc: @liggitt
2017-02-04 04:43:10 -08:00
Kubernetes Submit Queue b40fed9eef Merge pull request #40906 from du2016/checkAPIVersions
Automatic merge from submit-queue (batch tested with PRs 40906, 40924, 40938, 40902, 40911)

Check whether apiversions is empty

What this PR does / why we need it:
#39719 check whether apisversions get from /api is empty
Special notes for your reviewer:
@caesarxuchao
2017-02-04 03:49:50 -08:00
Jordan Liggitt af3505f53c
Add unit test framework for edit command 2017-02-04 00:11:29 -05:00
Kubernetes Submit Queue 55480054f7 Merge pull request #40894 from MHBauer/groupmetafactoryargs-doc
Automatic merge from submit-queue

GroupMetaFactoryArgs documentation

**What this PR does / why we need it**:
Documentation for people writing new API-Groups.

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

**Special notes for your reviewer**:
@deads2k @pmorie my thoughts from writing the service-catalog apiserver.

**Release note**:

```release-note
NONE
```
2017-02-03 16:22:46 -08:00
ymqytw a910284e17 extract util used by jsonmergepatch and SMPatch 2017-02-03 15:28:42 -08:00
deads2k 2b5b04d074 update negotiation to reflect current kubectl state 2017-02-03 14:43:58 -05:00
deads2k 0a536544b4 add liggitt to apimachinery/apiserver packages 2017-02-03 12:24:22 -05:00
Kubernetes Submit Queue 1271802692 Merge pull request #40909 from caesarxuchao/no-vendor-apimachinery
Automatic merge from submit-queue (batch tested with PRs 40862, 40909)

Remove apimachinery from staging client-go/Godeps/Godeps.json

The publishing robot will add the latest version of apimachinery to Godeps.json.

This is part of the effort to allow update staging apimachinery and staging client-go in a same PR.

The robot change is here: https://github.com/kubernetes/test-infra/pull/1784

@deads2k @stts @lavalamp
2017-02-03 06:48:47 -08:00
Dr. Stefan Schimanski 6af3210d6f Update generated files 2017-02-03 08:15:46 +01:00
Dr. Stefan Schimanski 536460e1d9 Mechanical fixup imports: pkg/genericapiserver 2017-02-03 08:15:45 +01:00
Dr. Stefan Schimanski 03beed51d6 Mechanical move: pkg/genericapiserver -> k8s.io/apiserver 2017-02-03 07:33:43 +01:00
Dr. Stefan Schimanski 80b96b441b Mechanical import fixup: pkg/storage 2017-02-03 07:33:43 +01:00
Dr. Stefan Schimanski abe993a808 Mechanical move: pkg/storage -> k8s.io/apiserver 2017-02-03 07:33:43 +01:00
Chao Xu 13f72310c4 remove apimachinery from client-go/Godeps/Godeps.json; the publishing
robot will add the latest version of apimachinery to Godeps.json.
2017-02-02 21:36:03 -08:00
dutianpeng 4acb99df52 Check whether apiversions is empty 2017-02-03 11:33:06 +08:00
ymqytw 8aa16e09d4 support generic 3-way json merge patch 2017-02-02 15:18:44 -08:00
Morgan Bauer 1169868d7b
GroupMetaFactoryArgs documentation 2017-02-02 15:11:13 -08:00
Dr. Stefan Schimanski 812e52019c client-go: add staging/copy.sh testing 2017-02-02 20:28:33 +01:00
Dr. Stefan Schimanski abeabeb7a6 client-go: fix examples 2017-02-02 20:28:32 +01:00
Dr. Stefan Schimanski 7aebe7c079 client-go: initial examples import 2017-02-02 20:28:32 +01:00
Kubernetes Submit Queue 62c9cb4684 Merge pull request #40853 from sttts/sttts-more-cutoffs-7
Automatic merge from submit-queue (batch tested with PRs 35782, 35831, 39279, 40853, 40867)

genericapiserver: cut off more dependencies – episode 7

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

approved based on #40363
2017-02-02 09:53:52 -08:00
Kubernetes Submit Queue 70c97b2c28 Merge pull request #40810 from deads2k/generic-37-generic-validation
Automatic merge from submit-queue (batch tested with PRs 40810, 40695)

move genericvalidation to apimachinery

Moves genericvalidation to apimachinery.  The first commit shows the snip I made.

@sttts
2017-02-02 08:07:47 -08:00
Dr. Stefan Schimanski 1834013f3e pkg/genericapiserver/registry/generic/registry: cut off pkg/api dependency 2017-02-02 15:17:34 +01:00
Dr. Stefan Schimanski ef8bb4e7e7 Move pkg/api.FinanlizerOrphan into metav1 2017-02-02 15:17:34 +01:00
deads2k 46767fcbac move genericvalidation to apimachinery 2017-02-02 07:37:00 -05:00
Dr. Stefan Schimanski 2f9fa55c6f pkg/storage/etcd: cut off pkg/api scheme 2017-02-02 11:16:28 +01:00
Dr. Stefan Schimanski a5d5527e96 pkg/genericapiserver/endpoints: cutting off pkg/api deps 2017-02-02 06:58:29 +01:00
Dr. Stefan Schimanski b51252ab5b Update protobufs 2017-02-02 06:58:29 +01:00
Dr. Stefan Schimanski 161ca53f49 k8s.io/apiserver: add example api group 2017-02-02 06:58:28 +01:00
Dr. Stefan Schimanski 55466b51bf pkg/api/testing: cut off fuzzers from static codecs 2017-02-02 06:58:28 +01:00
Kubernetes Submit Queue 80b21d2d4b Merge pull request #40806 from deads2k/generic-36-nodep
Automatic merge from submit-queue (batch tested with PRs 40574, 40806, 40308, 40771, 39440)

move api server no kube dep packages

Simple moves, see commit titles.  I did not move the source of the generated swagger, I simply change the destination of the script.  I'm ok building a little debt to complete the move.

@sttts
2017-02-01 16:12:45 -08:00
Kubernetes Submit Queue d06ff13b5a Merge pull request #40802 from deads2k/owners-04-client
Automatic merge from submit-queue

add OWNERS for client-go

client-go is the source (not a copy) for the generic client libraries we wrote.  This is a copy of the OWNERS file from `pkg/client`.
2017-02-01 14:43:41 -08:00
Kubernetes Submit Queue e75aafd0de Merge pull request #40612 from jcbsmpsn/share-certificate-loading-function
Automatic merge from submit-queue

Move certificate loading function where it can be shared.
2017-02-01 14:43:31 -08:00
Kubernetes Submit Queue 28aa23e5db Merge pull request #40735 from wojtek-t/avoid_copy_in_cacher
Automatic merge from submit-queue (batch tested with PRs 40124, 39216, 40561, 40595, 40735)

Avoid unnecessary copies in cacher
2017-02-01 12:32:51 -08:00
deads2k 6b57489552 move apiserver options 2017-02-01 15:18:33 -05:00
deads2k 9597cb150d move swagger route to apiserver 2017-02-01 15:18:32 -05:00
Kubernetes Submit Queue c523476d6f Merge pull request #40124 from mbohlool/separation
Automatic merge from submit-queue

Use full package path for definition name in OpenAPI spec

We were using short package name (last part of package name) plus type name for OpenAPI spec definition name. That can result in duplicate names and make the spec invalid. To be sure we will always have unique names, we are going to use full package name as definition name. Also "x-kubernetes-tag" custom field is added to definitions to list Group/Version/Kind for the definitions that has it. This will help clients to discover definitions easier.
Lastly, we've added a reference from old definition names to the new ones to keep backward compatibilities. The list of old definitions will not be updated.

**Release note**:
- Rename OpenAPI definition names to type's full package names to prevent duplicates
- Create OpenAPI extension "x-kubernetes-group-version-kind" for definitions to store Group/Version/Kind
- Deprecate old definition names and create a reference to the new definitions. Old definitions will be removed in the next release.
2017-02-01 12:06:39 -08:00
Andy Goldstein d8205df171 Make DeltaFIFO Resync atomic
Make DeltaFIFO's Resync operation atomic, so it enqueues the entire
queue before allowing adds/updates/deletes.
2017-02-01 13:36:09 -05:00
Kubernetes Submit Queue 056728067d Merge pull request #40658 from sttts/sttts-more-cutoffs-4
Automatic merge from submit-queue (batch tested with PRs 40798, 40658)

genericapiserver: cut off more dependencies – episode 4

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

TODO:
- [x] resync client-go before "genericapiserver: cutting off pkg/api deps" when #40426 went in and mirror repos are synched.

approved based on #40363
2017-02-01 07:54:43 -08:00
deads2k f131c2c02b add OWNERS for client-go 2017-02-01 07:45:53 -05:00
deads2k f3f7c98411 sync client-go 2017-02-01 07:42:54 -05:00
Dr. Stefan Schimanski d6adb51e6c pkg/api: move HasObjectMetaSystemFieldValues into apimachinery 2017-02-01 13:37:41 +01:00
Kubernetes Submit Queue 9807cd7d06 Merge pull request #40630 from liggitt/apply-null
Automatic merge from submit-queue (batch tested with PRs 40529, 40630)

propagate explicit nulls in apply

Rebase of https://github.com/kubernetes/kubernetes/pull/35496 on top of https://github.com/kubernetes/kubernetes/pull/40260

The client-side propagation of the raw value is no longer needed, since the client is preserving the original object in unstructured form (explicit nulls are preserved).

Kept tests and CreateThreeWayMergePatch changes from https://github.com/kubernetes/kubernetes/pull/35496

```release-note
kubectl apply now supports explicitly clearing values not present in the config by setting them to null
```

- [x] Clean up orphaned objects in test-cmd to preserve pre- and post- conditions
- [x] improve CreateThreeWayMergePatch test to not filter based on string comparison to test name
2017-02-01 00:16:39 -08:00
Wojciech Tyczynski 7b13f4396d Avoid unnecessary copies in cacher 2017-02-01 08:10:02 +01:00
Kubernetes Submit Queue 76550cf2de Merge pull request #40710 from deads2k/client-21-record
Automatic merge from submit-queue (batch tested with PRs 40638, 40742, 40710, 40718, 40763)

move client/record

An attempt at moving client/record to client-go.  It's proving very stubborn and needs a lot manual intervention and near as I can tell, no one actually gets any benefit from the sink and source complexity it adds.

@sttts @caesarchaoxu
2017-01-31 20:40:45 -08:00
Kubernetes Submit Queue 0469fc6fb6 Merge pull request #40742 from deads2k/generic-34-storage
Automatic merge from submit-queue (batch tested with PRs 40638, 40742, 40710, 40718, 40763)

move pkg/storage to apiserver

Mechanical move of `pkg/storage` (not sub packages) to `k8s.io/apiserver`.

@sttts
2017-01-31 20:40:43 -08:00
Kubernetes Submit Queue b5d92d6f7e Merge pull request #40508 from vjsamuel/master
Automatic merge from submit-queue

Preventing nil pointer reference in client_config

When a user tries to set the `extensions` map in the kube config, loading of the client config causes nil pointer exception because the `Context`, `Cluster`, `AuthInfo` objects are created without initializing the extensions map. This PR attempts to fix that.
2017-01-31 18:01:48 -08:00
deads2k a12d45a240 sync 2017-01-31 19:15:33 -05:00
deads2k 8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k 1ef5d26079 move pkg/storage to apiserver 2017-01-31 19:07:33 -05:00
Jordan Liggitt cf74abd892
fixup apply null tests 2017-01-31 15:00:23 -05:00
Anastasis Andronidis 31c6f49846
CreateThreeWayMergePatch should propagate explicit null fields 2017-01-31 14:22:24 -05:00
deads2k 700c30f3c7 move portforward to client-go 2017-01-31 14:13:35 -05:00
Dr. Stefan Schimanski 808339ea6c Sync client 2017-01-31 13:49:38 +01:00
Dr. Stefan Schimanski 11f0d77dff Fix k8s.io/client-go imports in authorative files before resync 2017-01-31 13:49:38 +01:00
Dr. Stefan Schimanski f0796a7124 staging/copy.sh: use gsed on Mac if available 2017-01-31 13:49:38 +01:00
mbohlool 300b28354c Add backward compatibility to OpenAPI spec for renamed definitions 2017-01-30 20:05:19 -08:00
mbohlool 239169a5a4 Use full package path as definition name in OpenAPI 2017-01-30 20:05:18 -08:00
Kubernetes Submit Queue 1bbd9dfa11 Merge pull request #39810 from enj/enj/f/and_selectors
Automatic merge from submit-queue (batch tested with PRs 40703, 40093, 40618, 40659, 39810)

Add AndSelectors helper function

I needed a simple way to logically `AND` two `Selectors` in https://github.com/openshift/origin/pull/11909 for [this](7259bf7596/pkg/oauth/registry/oauthclientauthorization/etcd/etcd.go (L95-L114)).

This seems like the cleanest way to express that intent.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-01-30 17:14:57 -08:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Jacob Simpson f15e6aac32 Move certificate loading function where it can be shared. 2017-01-30 09:28:50 -08:00
deads2k 2c1c0f3f72 move workqueue to client-go 2017-01-30 09:08:21 -05:00
deads2k 2667556257 update client-go 2017-01-30 09:06:59 -05:00
Kubernetes Submit Queue 2cb17cc677 Merge pull request #40426 from sttts/sttts-more-cutoffs-3
Automatic merge from submit-queue

genericapiserver: cut off more dependencies – episode 3

Compare commit subjects.

This is the first step to get `apiserver_test.go` and `watch_test.go` in `pkg/genericapiserver/endpoints` cutoff from k8s.io/kubernetes dependencies.

After this we have to sync client-go and then "episode 4" can go in.

approved based on #40363
2017-01-30 05:57:49 -08:00
Kubernetes Submit Queue 5d8e607ef2 Merge pull request #40660 from sttts/sttts-fix-staging-copy-on-mac
Automatic merge from submit-queue (batch tested with PRs 39832, 40660)

staging/copy.sh: fix on mac

BSD-vs-GNU `sed -i`. This variant works on both.
2017-01-30 01:32:16 -08:00
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski 79adb99a13 pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Dr. Stefan Schimanski 6b6b6c747e pkg/api/testing: split fuzzer between apimachinery and kube 2017-01-29 21:41:44 +01:00
Dr. Stefan Schimanski a12c661773 pkg/util: move trace.go to k8s.io/apiserver/pkg/util/trace 2017-01-29 21:41:44 +01:00
Kubernetes Submit Queue 4bba610565 Merge pull request #40605 from deads2k/generic-32-movehttpstream
Automatic merge from submit-queue

pkg/util: move httpstream to k8s.io/apimachinery

pick one commit from @sttts's pull https://github.com/kubernetes/kubernetes/pull/40426

This blocks some client-go splitting, so I'm picking it out and merging it separately.  It's not my commit, so its not a self-lgtm in that sense.

approved based on https://github.com/kubernetes/kubernetes/issues/40363
2017-01-29 05:15:22 -08:00
Dr. Stefan Schimanski 4619a3e263 staging/copy.sh: fix on mac 2017-01-29 13:29:30 +01:00
Kubernetes Submit Queue fe2829c16d Merge pull request #40497 from lavalamp/log2much
Automatic merge from submit-queue

Make HandleError prevent hot-loops

Add an error "handler" that just sleeps for a bit if errors happen more
often than 500ms. Manually tested against #39816. This doesn't fix #39816 but it does keep it from crippling a cluster.

```release-note
Prevent hotloops on error conditions, which could fill up the disk faster than log rotation can free space.
```
2017-01-27 17:26:03 -08:00