Commit Graph

58 Commits

Author SHA1 Message Date
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Jordan Liggitt
ef4983fb52 Update generated files 2019-01-15 13:33:06 -05:00
Jordan Liggitt
fd9e9b01b1 Remove uses of extensions/v1beta1 clients 2018-12-19 11:18:53 -05:00
Antoine Pelisse
ae735282ad Create a method to check dryRun is supported
We don't want to run dryRun requests against servers that don't support
dry-run, since they might ignore the flag and just persist the unwanted
changes.

This creates a new method that checks in the OpenAPI if the dryRun
parameter can be used.
2018-10-10 08:55:33 -07:00
k8s-ci-robot
7136a3e4b2
Merge pull request #67880 from chenyb4/kubectl_openapi
Add kubectl openapi doc import comment
2018-10-04 01:05:15 -07:00
Sean Sullivan
9e2b995b54 kubectl validation test: remove unused testapi dependency 2018-10-02 13:09:29 -07:00
Yuanbin.Chen
d6482d6fd0 Add kubectl openapi doc import comment
Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>
2018-08-27 15:20:38 +08:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton
a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Antoine Pelisse
000510d9b7 Replace openapi Fake with kube-openapi version
There are two version of this fake class, let's just use that one
version.
2018-06-01 09:50:05 -07:00
Antoine Pelisse
178a8f87f3 openapi: Remove FakeClient from testing library
And make a simplified version of it where needed.
2018-05-31 13:44:08 -07:00
Di Xu
82cc3b5d59 kubectl stops rendering List as suffix kind name for CRD resources 2018-04-19 21:21:03 +08:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
juanvallejo
13add66f1e
tolerate more than one gvklist item
Some third-party resources could be part of more than one api group.
Allow this to be the case when adding openapi models to openapi data.
2018-01-19 14:24:03 -05:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Kubernetes Submit Queue
9a0bbd0aa9
Merge pull request #53765 from tanshanshan/fix-bug1
Automatic merge from submit-queue (batch tested with PRs 54529, 53765). 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  #53735, check whether  interface conversion is ok

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

fix #53735

avoid interface conversion error 

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-11-21 21:38:59 -08:00
Antoine Pelisse
9778b1a9ba openapi: Add EmptyResource/CreateOpenAPISchemaFunc test utils
Add a new EmptyResource class that implements openapi.Resources, but
just doesn't have any resources. That is useful for tests that expect
the OpenAPISchema to be working, but don't expect any actual result.

Also implement CreateOpenAPISchemaFunc to simply plug in the TestFactory
code when you want to use an actual APISchema.
2017-11-15 14:02:13 -08:00
Antoine Pelisse
5c3c0f6e5b Add apelisse to OWNERS
I wrote most of this code anyway.
2017-11-09 15:39:31 -08:00
Antoine Pelisse
8f7262e819 Update kube-openapi to use validation 2017-11-02 09:25:03 -07:00
Kubernetes Submit Queue
507790c9c6 Merge pull request #54181 from apelisse/update-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 54199, 54181, 54196). 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 openapi to use kube-openapi code

**What this PR does / why we need it**: OpenAPI code has moved to `github.com/kubernetes/kube-openapi`. Let's use that code as a dependency, since now it's duplicated.

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

**Special notes for your reviewer**:

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

No user visible changes. Just code moving around.
2017-10-20 18:57:03 -07:00
Antoine Pelisse
3ed58475c4 Update openapi to use kube-openapi code 2017-10-20 09:21:06 -07:00
Sahdev P. Zala
07be0a057a Create new unit tests for version and kind validation
This is a follow up PR per discussion in the
https://github.com/kubernetes/kubernetes/pull/53587
Creating new unit tests here for basic and aggregated validation of version
and kind group.
2017-10-17 23:10:20 -04:00
tanshanshan
d2caaf1cbe fix bug 2017-10-18 10:06:06 +08:00
Sahdev P. Zala
0c0a4696c7 Provide aggregated validation errors for version and kind
Currently the validation checks is done individually for version and
kind group. For example, if user provided yaml file is missing apiVersion
and kind fields, first they will receive error on apiVersion. Once user
update the file and try to recreate, an error on missing kind is displayed.
The behavior is same for wrong types of the fields.
These errors should be aggregated and displayed.
2017-10-17 13:31:12 -04:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Dr. Stefan Schimanski
a6f0cd01ee Get rid of pkg/api/util 2017-10-12 16:36:32 +02:00
Antoine Pelisse
996bc521ee openapi: Add fake resource to simplify tests 2017-10-03 09:44:14 -07:00
Antoine Pelisse
249caa95b5 Rewrite kubectl explain to use openapi
This removes all dependencies on swagger 1.2 for explain.
2017-10-03 09:44:11 -07:00
Kubernetes Submit Queue
1ddf2e8ab9 Merge pull request #52742 from apelisse/validate-resource-even-if-unregistered
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>.

openapi: Validate unregistered type, if they can be found

**What this PR does / why we need it**:
Types that are not registered/hard-coded in kubectl won't be validated, even if they could because they are defined in openapi. If they are neither registered nor in openapi, then skip validation. 

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-10-02 07:14:02 -07:00
Antoine Pelisse
d13c6d77eb openapi: Validate unregistered type, if they can be found 2017-09-29 20:22:15 -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
Guangya Liu
e005da697c Fixed test issue for image validation. 2017-09-20 00:38:28 -04:00
ymqytw
c17103f184 Revert "remove dup pkg and update reference"
This reverts commit 93be3f7735.

Revert "update vendor kube-openapi"

This reverts commit 006f80e35d.
2017-09-06 12:30:53 -07:00
ymqytw
93be3f7735 remove dup pkg and update reference 2017-09-04 18:20:25 -07:00
Antoine Pelisse
54b9c22f2a openapi: Remove unused test structure and code. 2017-09-01 08:45:44 -07:00
Antoine Pelisse
332b681bd1 Revert "Revert "Merge pull request #47353 from apelisse/http-cache""
This reverts commit 4ee72eb300.
2017-08-25 08:31:49 -07:00
Antoine Pelisse
5ef3516780 openapi: Change reference to be first-class
References in the openapi are currently completely hidden from the
model, and just passed through as we walk the tree. The problem is that
they can have a different description and more importantly, different
extensions.

Change them to be first-class citizen, and fully part of the model. It
means that visitors have to implement one more function and decide if
something specific should be done with references. Validation is updated
to just completely ignore them and passthrough (like it was done
before).
2017-08-23 14:11:16 -07:00
Antoine Pelisse
37aacf30b5 openapi validation: Ignore unknown types
This follows the exact same logic as swagger.
2017-08-21 09:08:31 -07:00
Antoine Pelisse
a950afecdc openapi-validation: Handle List special case 2017-08-21 09:08:31 -07:00
Antoine Pelisse
4e87d2d572 openapi: Handle properly empty/null fileds 2017-08-21 09:08:31 -07:00
Antoine Pelisse
aa1c79f32b openapi: Use "group" to look for resources 2017-08-21 09:08:31 -07:00
Antoine Pelisse
b7b5457050 Validate against OpenAPI schema (if available) 2017-08-21 08:58:42 -07:00
Antoine Pelisse
ba11c7370f openapi: Add validation logic
This allows validation of a yaml/json object against an openapi schema.
A lot more testing would be needed to validate the logic, and also this
is not plumbed in, so it can't be used by kubectl yet.
2017-08-11 17:02:31 -07:00
Antoine Pelisse
eb735bfeb0 openapi: Move Fakes to testing package 2017-08-11 15:28:04 -07:00
Jeff Grafton
a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton
33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Jeff Grafton
cf55f9ed45 Autogenerate BUILD files 2017-08-11 09:30:23 -07:00
Jordan Liggitt
4ee72eb300
Revert "Merge pull request #47353 from apelisse/http-cache"
This reverts commit fc89743dca, reversing
changes made to 29ab38e898.
2017-08-07 16:20:34 -04:00
Antoine Pelisse
a1d0384e82 openapi: Remove cache mechanism
The cache will be removed and replaced with HTTP Etag caching instead.
This patch is simply removing the existing mechanism.
2017-08-04 14:36:32 -07:00