Commit Graph

535 Commits (f32b390cf08a9afd9f9899e0d97a90eb162b32a8)

Author SHA1 Message Date
mbohlool cac0144911 Add patchMergeKey and patchStrategy support to OpenAPI 2017-04-07 15:44:32 -07:00
Kubernetes Submit Queue fa98c5fed4 Merge pull request #43247 from mbohlool/extensions_fix
Automatic merge from submit-queue (batch tested with PRs 42617, 43247, 43509, 43644, 43820)

Bugfix: OpenAPI-gen was not generating extensions correctly

Fixes a bug in openapi-gen that generated invalid code if x-kubernetes extensions defined in types.go. The location of VendorExtensions was wrong.
2017-03-29 16:05:21 -07:00
Christoph Blecker 6681835b0c
Fix gofmt errors 2017-03-28 17:12:04 -07:00
timchenxiaoyu 1e9662e7c8 fix second typo 2017-03-23 21:10:12 +08:00
Jordan Liggitt 0e2f1b535d
Ensure empty serialized slices are zero-length, not null 2017-03-20 23:56:39 -04:00
mbohlool 6dd38a4350 Bugfix: OpenAPI-gen was not generating extensions correctly 2017-03-17 01:44:10 -07:00
Dr. Stefan Schimanski 26662b39a7 conversion-gen: make duplicate func error message readable 2017-03-14 17:35:41 +01:00
Morgan Bauer 1d48c1a0d7
Remove defaults from string flags
- The default is printed automatically
 - The string text did not match the actual default
2017-03-02 18:40:45 +00:00
Jan Safranek 584b57b8b4 Add storage.k8s.io/v1 2017-03-02 08:55:25 +01:00
Jess Frazelle fe84363ce2
Add settings API and admission controller
export functions from pkg/api/validation

add settings API

add settings to pkg/registry

add settings api to pkg/master/master.go

add admission control plugin for pod preset

add new admission control plugin to kube-apiserver

add settings to import_known_versions.go

add settings to codegen

add validation tests

add settings to client generation

add protobufs generation for settings api

update linted packages

add settings to testapi

add settings install to clientset

add start of e2e

add pod preset plugin to config-test.sh

Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-03-01 13:04:28 -08:00
Dr. Stefan Schimanski fc6d87c0a2 Update client 2017-02-28 15:34:34 +01:00
Dr. Stefan Schimanski b621774095 Update bazel 2017-02-28 15:28:30 +01:00
Dr. Stefan Schimanski ee8ce696d6 client-gen: create private registry for fake clientset 2017-02-28 15:25:10 +01:00
mbohlool 8dc91dc0f7 Sort types before processing for openapi-gen 2017-02-27 14:08:43 -08:00
Jordan Liggitt 41c88e0455
Revert "Merge pull request #40088 from jsafrane/storage-ga-v1"
This reverts commit 5984607cb9, reversing
changes made to 067f92e789.
2017-02-25 22:35:15 -05:00
Kubernetes Submit Queue 5984607cb9 Merge pull request #40088 from jsafrane/storage-ga-v1
Automatic merge from submit-queue (batch tested with PRs 41854, 41801, 40088, 41590, 41911)

Add storage.k8s.io/v1 API

v1 API is direct copy of v1beta1 API. This v1 API gets installed and exposed in this PR, I tested that kubectl can create both v1beta1 and v1 StorageClass.

~~Rest of Kubernetes (controllers, examples,. tests, ...) still use v1beta1 API, I will update it when this PR gets merged as these changes would get lost among generated code.~~ Most parts use v1 API now, it would not compile / run tests without it.

**Release note**:
```
Kubernetes API storage.k8s.io for storage objects is now fully supported and is available as storage.k8s.io/v1. Beta version of the API storage.k8s.io/v1beta1 is still available in this release, however it will be removed in a future Kubernetes release.

Together with the API endpoint, StorageClass annotation "storageclass.beta.kubernetes.io/is-default-class" is deprecated and  "storageclass.kubernetes.io/is-default-class" should be used instead to mark a default storage class. The beta annotation is still working in this release, however it won't be supported in the next one.
```

@kubernetes/sig-storage-misc
2017-02-25 05:02:55 -08:00
Kubernetes Submit Queue 43d8110225 Merge pull request #41094 from MHBauer/client-gen-gv-parse
Automatic merge from submit-queue (batch tested with PRs 40665, 41094, 41351, 41721, 41843)

parse single string as group rather than version

**What this PR does / why we need it**:
Prevent bad code generation by adjusting parsing of input.

When client-gen is run with `--input` as an unversioned type, it blows up if the group does not end with a trailing slash.

examples
1. `--input servicecatalog/v1alpha` is group servicecatalog, with version v1alpha1
1. `--input servicecatalog/` is group servicecatalog, with version empty string
1. `--input servicecatalog` is group empty string, with version servicecatalog

I disagree that the second and third cases are different. This adjusts them so they are both case 2.


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

This change would address the concerns in PR https://github.com/kubernetes/community/pull/343

**Special notes for your reviewer**:
@caesarxuchao @pmorie this does not result in any change in any current code generation, and improves the user experience of client-gen. I ran `hack/update-codegen.sh` and saw no changes in git, nor did anything fail.

**Release note**:
```release-note
NONE
```
2017-02-25 03:56:53 -08:00
Jan Safranek 3f6caca97a Add storage.k8s.io/v1 2017-02-24 13:34:18 +01:00
Kubernetes Submit Queue e5c2d716d9 Merge pull request #41887 from liggitt/watch-verb
Automatic merge from submit-queue (batch tested with PRs 39855, 41433, 41567, 41887, 41652)

Use watch param instead of deprecated /watch/ prefix

Reopen of https://github.com/kubernetes/kubernetes/pull/41722 after reverted in https://github.com/kubernetes/kubernetes/pull/41774

Required https://github.com/kubernetes/kubernetes/pull/41797 to merge first

cc @deads2k @wojtek-t
2017-02-23 09:36:35 -08:00
Dr. Stefan Schimanski 595f4ed2cb Update generated files 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 92c36bed4a client-set: use clientset internal scheme 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 49c536baee client-gen: general cleanup 2017-02-22 19:03:25 +01:00
Dr. Stefan Schimanski 0834ff7943 Switch to GroupMetaFactory in federation and clientset testgroup 2017-02-22 19:03:25 +01:00
Jordan Liggitt 4202489a89
regenerate clients 2017-02-22 08:54:13 -05:00
Jordan Liggitt 7b6ef2cedc
Switch watch prefixes to params 2017-02-22 08:54:08 -05:00
Eric Chiang 163f37f775 *: update codegen and bazel 2017-02-21 09:26:03 -08:00
Eric Chiang 58dde796ec client-go: don't import client auth provider packages 2017-02-21 09:26:03 -08:00
Wojciech Tyczynski a21b08d00f Revert "Use watch param instead of deprecated /watch/ prefix" 2017-02-21 08:37:51 +01:00
Jordan Liggitt 029cf08e6f
regenerate clients 2017-02-19 23:51:59 -05:00
Jordan Liggitt f950171003
Switch watch prefixes to params 2017-02-19 23:51:58 -05:00
deads2k c5359fd059 split generated informers by internal and external 2017-02-13 07:55:15 -05:00
Kubernetes Submit Queue f9215e8fb3 Merge pull request #41058 from liggitt/v1-tokenreview
Automatic merge from submit-queue (batch tested with PRs 41112, 41201, 41058, 40650, 40926)

Promote TokenReview to v1

Peer to https://github.com/kubernetes/kubernetes/pull/40709

We have multiple features that depend on this API:

- [webhook authentication](https://kubernetes.io/docs/admin/authentication/#webhook-token-authentication)
- [kubelet delegated authentication](https://kubernetes.io/docs/admin/kubelet-authentication-authorization/#kubelet-authentication)
- add-on API server delegated authentication

The API has been in use since 1.3 in beta status (v1beta1) with negligible changes:
- Added a status field for reporting errors evaluating the token

This PR promotes the existing v1beta1 API to v1 with no changes

Because the API does not persist data (it is a query/response-style API), there are no data migration concerns.

This positions us to promote the features that depend on this API to stable in 1.7

cc @kubernetes/sig-auth-api-reviews @kubernetes/sig-auth-misc

```release-note
The authentication.k8s.io API group was promoted to v1
```
2017-02-10 01:40:44 -08:00
Kubernetes Submit Queue 45d122dd6b Merge pull request #36033 from DirectXMan12/feature/hpa-v2
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)

HPA v2 (API Changes)

**Release note**:
```release-note
Introduces an new alpha version of the Horizontal Pod Autoscaler including expanded support for specifying metrics.
```

Implements the API changes for kubernetes/features#117.

This implements #34754, which is the new design for the Horizontal Pod Autoscaler.  It includes improved support for custom metrics (and/or arbitrary metrics) as well as expanded support for resource metrics.  The new HPA object is introduces in the API group "autoscaling/v1alpha1".

Note that the improved custom metric support currently is limited to per pod metrics from Heapster -- attempting to use the new "object metrics" will simply result in an error.  This will change once #34586 is merged and implemented.
2017-02-10 00:04:48 -08:00
Kubernetes Submit Queue 812a8e3861 Merge pull request #40959 from mbohlool/tags
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

Add OpenAPI extensions to openapi_gen (Definition Generator)

fixes #40818
2017-02-09 16:44:41 -08:00
mbohlool 317376de30 Add OpenAPI extensions to openapi_gen (Definition Generator) 2017-02-07 16:13:29 -08:00
Solly Ross 86c430b881 Introduce HPA v2 API Objects
This commit introduces the autoscaling/v2alpha1 API group, which
currently contains the first alpha of the new HorizontalPodAutoscaler
object.
2017-02-07 17:20:14 -05:00
Morgan Bauer 45b3d6f75a
parse single string as group rather than version 2017-02-07 21:14:37 +00:00
Jordan Liggitt 09b5d7279f
install authentication.k8s.io/v1, add tests 2017-02-07 01:44:56 -05:00
Jordan Liggitt 8706bc9617
install authorization.k8s.io/v1, add tests
Use specific v1beta1 Authorization client

Add client expansions
2017-02-06 18:16:51 -05:00
Dr. Stefan Schimanski 161ca53f49 k8s.io/apiserver: add example api group 2017-02-02 06:58:28 +01:00
Dr. Stefan Schimanski 5486c6a56a conversion-gen: add vendor package support 2017-02-02 06:58:28 +01: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
Kubernetes Submit Queue 96cfe7b938 Merge pull request #36734 from YuPengZTE/devPunctuation
Automatic merge from submit-queue

error strings should not end with punctuation

**What this PR does / why we need it**:
Delete the end punctuation of error strings
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
**Release note**:

```release-note
```

Signed-off-by: yupeng <yu.peng36@zte.com.cn>
2017-02-01 02:55:48 -08:00
Jordan Liggitt aa4a3e1613
Regenerate clients 2017-01-31 11:16:27 -05:00
Jordan Liggitt 4b3462456a
Stop including full arguments list in generated clients
Including custom arguments means adding any new group/version results in a diff of all generates clients in all groups/versions
2017-01-31 11:13:37 -05:00
mbohlool 239169a5a4 Use full package path as definition name in OpenAPI 2017-01-30 20:05:18 -08:00
Kubernetes Submit Queue 553438e90a Merge pull request #40700 from liggitt/lister-gen-cleanup
Automatic merge from submit-queue (batch tested with PRs 40691, 40551, 40683, 40700, 40702)

Clean up generated comment for lister/informers

The generated comment including the command line means the addition of a new group/version touches all listers/informers, not just the ones for the new group/version

@ncdc PTAL
2017-01-30 19:14:44 -08:00
Jordan Liggitt c4e52d3df2
Regenerate listers/informers 2017-01-30 15:46:36 -05:00
Jordan Liggitt cef71341c5
Remove command line from informer/lister generated comment
Avoids spurious diffs to all generated files when a new group/version is added
2017-01-30 14:42:42 -05:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
deads2k 9488e2ba30 move testing/core to client-go 2017-01-26 13:54:40 -05:00
deads2k 2734f8f892 move dynamic and discovery clients 2017-01-26 08:37:06 -05:00
deads2k b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
Clayton Coleman 7b1c715496
generated: Move references to metav1.*Options 2017-01-24 13:41:48 -05:00
Clayton Coleman 1a49fc3283
client-gen should use metav1.DeleteOptions 2017-01-24 13:15:26 -05:00
Clayton Coleman fca7e00608
Move all *Options to metav1 2017-01-24 13:15:26 -05:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Clayton Coleman 9009c1ac14
generated: informer,client 2017-01-23 17:52:47 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Clayton Coleman c12344b3b8
Tests that check metav1 2017-01-23 16:53:19 -05:00
Clayton Coleman f623a8c908
Make all groups use metav1.AddToGroupVersion for ListOptions 2017-01-23 16:53:18 -05:00
Clayton Coleman 93e7c60ae0
Generators should reference metav1.ListOptions (informer,client,fake) 2017-01-23 16:53:18 -05:00
Antoine Pelisse 62af7dd33d OWNERS: Update latest OWNERS files
These files have been created lately, so we don't have much information
about them anyway, so let's just:
- Remove assignees and make them approvers
- Copy approves as reviewers
2017-01-23 10:05:48 -08:00
Kubernetes Submit Queue 66c59e491e Merge pull request #40240 from ncdc/shared-informers-01
Automatic merge from submit-queue (batch tested with PRs 40232, 40235, 40237, 40240)

Expose ForResource in generated informer factory, copy lister expansions

Expose ForResource in generated informer factory

Copy lister expansions from pkg/client/cache into pkg/client/listers

@deads2k
2017-01-20 14:22:53 -08:00
Andy Goldstein 307acab3f3 Expose ForResource in generated informer factory 2017-01-20 12:41:37 -05:00
deads2k 9d3dfbf630 move apimachinery/announced to apimachinery 2017-01-20 12:20:13 -05:00
deads2k dfd8db8ae9 allow API groups to be installed and registered in multiple schemes 2017-01-20 12:19:49 -05:00
deads2k 9c6a522882 mechanical results of client auth plugin 2017-01-20 08:05:18 -05:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
deads2k c587b8a21e re-run client-gen 2017-01-20 08:02:36 -05:00
deads2k 32a2c2d05c remove old restclient 2017-01-20 07:56:35 -05:00
Mike Danese 96c146c8f2 promote certificates.k8s.io to beta 2017-01-19 13:13:20 -08:00
deads2k 11e8068d3f move pkg/fields to apimachinery 2017-01-19 09:50:16 -05:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
deads2k e74efe41a0 add rbac v1beta1 2017-01-18 09:49:33 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
Clayton Coleman 9fd9c33264
Informer/lister can't use ObjectMeta to detect internal
Instead look for json tags
2017-01-17 16:17:18 -05:00
Clayton Coleman 36acd90aba
Move APIs and core code to use metav1.ObjectMeta 2017-01-17 16:17:18 -05:00
Kubernetes Submit Queue e5fe366eaf Merge pull request #39894 from deads2k/client-03-remove-old
Automatic merge from submit-queue

Remove packages which are now apimachinery

Removes all the content from the packages that were moved to `apimachinery`.  This will force all vendoring projects to figure out what's wrong.  I had to leave many empty marker packages behind to have verify-godep succeed on vendoring heapster.

@sttts straight deletes and simple adds
2017-01-17 12:00:00 -08:00
deads2k f31ecdd0f7 generated changes 2017-01-17 08:32:05 -05:00
deads2k 26c46971f2 move PatchType to apimachinery 2017-01-17 08:32:05 -05:00
deads2k 67fac70ea3 remove files moved to apimachinery 2017-01-17 07:46:34 -05:00
deads2k 7993e7c8aa move openapi types to pkg/openapi 2017-01-16 13:40:14 -05:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Clayton Coleman e4b39b17d4
Protobuf generation for staged packages 2017-01-13 16:20:03 -05:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
deads2k 05eb75612f replace global registry in apimachinery with global registry in k8s.io/kubernetes 2017-01-12 15:14:07 -05:00
Dr. Stefan Schimanski 2741eb7fdb Update generated files 2017-01-11 21:54:07 +01:00
Kubernetes Submit Queue 931bccf907 Merge pull request #38666 from tanshanshan/empty-check
Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613)

Add checking the nil value 

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

Add checking the nil value.

Thanks.

**Special notes for your reviewer**:
2017-01-11 09:14:52 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
deads2k 70778cccfe k8s.io/apimachinery scripts 2017-01-11 08:15:34 -05:00
tanshanshan 7d4b594c64 check nil 2017-01-11 11:35:36 +08:00
Clayton Coleman e5019de260
refactor: Move versioned/watch to meta/v1 2017-01-06 23:45:03 -05:00
Clayton Coleman b7d03ed3d5
Move watch/versioned to pkg/apis/meta/v1/watch.go
Move the encoder and decoder to restclient since it is generic to that
package.
2017-01-06 23:45:00 -05:00
Kubernetes Submit Queue 07ce35a325 Merge pull request #39490 from deads2k/generic-16-bump-gengo
Automatic merge from submit-queue (batch tested with PRs 39466, 39490, 39527)

bump gengo to latest

bumping gengo to limit surprises while working on https://github.com/kubernetes/kubernetes/pull/39475

@kubernetes/sig-api-machinery-misc
2017-01-06 11:30:13 -08:00
Kubernetes Submit Queue 181df90d2f Merge pull request #39466 from kubernetes/bugfix
Automatic merge from submit-queue (batch tested with PRs 39466, 39490, 39527)

Generate OpenAPI definition for inlined types

Currently OpenAPI definition generator ignores any type's member with an empty json name tag. However, most (if not all) of these types also have "inline" json tag. That means we should inline their members into parent type's OpenAPI definition instead of ignoring them. This resulted in many types missing common parameters such as "Name". It look something serious to me for OpenAPI spec and I suggest we merge and cherry-pick this into 1.5 release branch as soon as possible.
2017-01-06 11:30:11 -08:00
deads2k f86447c9a0 files regenerated after update 2017-01-06 11:45:40 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
mbohlool c4291993b6 Generate inlined member's OpenAPI definitions 2017-01-05 09:45:35 -08:00