Commit Graph

101 Commits

Author SHA1 Message Date
Kubernetes Publisher
342d9152cf Merge pull request #66218 from atlassian/handle-errors
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). 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>.

Handle errors

**What this PR does / why we need it**:
This is a followup PR for https://github.com/kubernetes/kubernetes/pull/64664 to handle errors returned from `.AddToScheme()` in places where they are not handled.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
/cc @sttts

Kubernetes-commit: 6c500be0808cfe9aff1141ec83ad885d04dd25ae
2018-07-20 21:52:03 +00:00
Kubernetes Publisher
b31118a167 Merge pull request #65256 from liggitt/crd-schema-openapi
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). 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 CRD OpenAPI schema

fixes #65243
depends on https://github.com/kubernetes/kube-openapi/pull/84

without this PR, kubectl complains about creating this CRD with a validation schema (which worked in 1.10):
```yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: resources.mygroup.example.com
spec:
  group: mygroup.example.com
  version: v1alpha1
  scope: Namespaced
  names:
    plural: resources
    singular: resource
    kind: Kind
    listKind: KindList
  validation:
    openAPIV3Schema:
      properties:
        spec:
          type: array
          items:
            type: number
```

> error: error validating "/Users/jliggitt/projects/snippets/crd/crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): unknown field "type" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "Schema" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "JSONSchemas" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray]; if you choose to ignore these errors, turn validation off with --validate=false

that is because the types used to serialize JSONSchema require custom marshaling/unmarshaling, and the OpenAPI generator was not informed of that, so it produced this:
```json
{
    "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray": {
    "description": "JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.",
    "required": [
     "Schema",
     "JSONSchemas"
    ],
    "properties": {
     "JSONSchemas": {
      "type": "array",
      "items": {
       "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
      }
     },
     "Schema": {
      "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
     }
    }
   }
}
```

OpenAPI isn't able to represent oneOf/anyOf types correctly currently. Until it can, we definitely shouldn't publish a schema containing required fields which aren't even part of the JSON serialization. This PR implements custom openapi type functions, which omit the properties/required/schema attributes for four specific JSONSchema types. This allows kubectl to continue creating these objects without complaining.

/sig api-machinery
/assign @sttts

```release-note
fixed incorrect OpenAPI schema for CustomResourceDefinition objects
```

Kubernetes-commit: ed6c8b7326bd1a1b845719f4bfb302073a18f03f
2018-06-21 04:31:22 +00:00
Kubernetes Publisher
4584dc3378 Merge pull request #63100 from ravisantoshgudimetla/priority-beta-api
Automatic merge from submit-queue (batch tested with PRs 55511, 63372, 63400, 63100, 63769). 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>.

Create pkg/scheduling/apis/v1beta1 and move priorityClass to beta

**What this PR does / why we need it**:
This is for creating pkg/apis/scheduling/v1beta1 so that priorityClasses could be moved to beta.

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

**Special notes for your reviewer**:
/cc @bsalamat @aveshagarwal

**Release note**:

```release-note
The `PriorityClass` API is promoted to `scheduling.k8s.io/v1beta1`
```

Kubernetes-commit: a1b54f3c99f2ae4d7d10c269939e5c0bb6d03e6f
2018-05-14 23:35:45 +00:00
Kubernetes Publisher
69245a1d17 Merge pull request #62657 from matthyx/master
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>.

Update all script shebangs to use /usr/bin/env interpreter instead of /bin/interpreter

This is required to support systems where bash doesn't reside in /bin (such as NixOS, or the *BSD family) and allow users to specify a different interpreter version through $PATH manipulation.
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html
```release-note
Use /usr/bin/env in all script shebangs to increase portability.
```

Kubernetes-commit: b5f61ac129019d314e473584c1491b7ca62144c7
2018-05-03 07:19:12 +00:00
Kubernetes Publisher
c0feae0701 Merge pull request #63059 from ceshihao/upgrade_json_package_fix_base64_newline
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). 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 dep json-iterator/go to fix base64 decode bug

**What this PR does / why we need it**:
upgrade dep `json-iterator/go` to fix base64 decode bug #62742

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

**Special notes for your reviewer**:
Just upgrade `json-iterator/go` to latest which includes base64 decode fix https://github.com/json-iterator/go/pull/266
No other code changes

**Release note**:

```release-note
None
```

Kubernetes-commit: 3dbcd1ddcee786f443f89a82514bbd9c6ad06c99
2018-04-26 07:24:17 +00:00
Kubernetes Publisher
8d405dd3e1 Merge pull request #62273 from atlassian/dont-log-when-error-returned
Automatic merge from submit-queue (batch tested with PRs 62273, 62461). 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>.

Don't log when error returned

**What this PR does / why we need it**:
Both logging and returning an error is an antipattern. If the caller wants it logged they will log it. And in this case it will be logged twice which is very confusing for debugging.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery

Kubernetes-commit: 0b5fa0b94a2e147ddae2278623c89648c211d229
2018-04-12 15:18:59 +00:00
Kubernetes Publisher
637ec76c82 Merge pull request #59172 from fisherxu/removeyear
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 YEAR field of all generated files and fix kubernetes boilerplate checker

**What this PR does / why we need it**:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: [remove YEAR fileds in gengo #91](https://github.com/kubernetes/gengo/pull/91)

**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 [#gengo/issues/24](https://github.com/kubernetes/gengo/issues/24)

**Special notes for your reviewer**:
/cc @thockin @lavalamp @sttts

**Release note**:

```release-note
NONE
```

Kubernetes-commit: e40ffd71972b820aeed283946e880aa2479f8524
2018-03-21 23:28:20 +00:00
Kubernetes Publisher
b7a35d54d8 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 23:27:59 +00:00
Kubernetes Publisher
02ef63233b sync: update godeps 2018-03-21 19:31:28 +00:00
Kubernetes Publisher
582615ab52 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 19:31:08 +00:00
Kubernetes Publisher
57eca8415c sync: update godeps 2018-03-21 15:26:19 +00:00
Kubernetes Publisher
d0e10ce699 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 15:25:56 +00:00
Kubernetes Publisher
511f33a332 sync: update godeps 2018-03-21 11:26:21 +00:00
Kubernetes Publisher
a202d033e8 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 11:25:57 +00:00
Kubernetes Publisher
a2dbfe8c0d sync: update godeps 2018-03-21 07:24:56 +00:00
Kubernetes Publisher
d04cd64012 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 07:24:35 +00:00
Kubernetes Publisher
563a85b29d sync: update godeps 2018-03-21 03:25:19 +00:00
Kubernetes Publisher
bf4ca65404 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-21 03:24:58 +00:00
Kubernetes Publisher
c86d2ce296 sync: update godeps 2018-03-20 23:26:06 +00:00
Kubernetes Publisher
7e9e402e3c sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 23:25:43 +00:00
Kubernetes Publisher
74471579f8 sync: update godeps 2018-03-20 19:28:23 +00:00
Kubernetes Publisher
43ba8acf92 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 19:28:01 +00:00
Kubernetes Publisher
26b988f72c sync: update godeps 2018-03-20 15:33:43 +00:00
Kubernetes Publisher
78293f14af sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 15:33:21 +00:00
Kubernetes Publisher
023a4501a0 sync: update godeps 2018-03-20 10:13:03 +00:00
Kubernetes Publisher
e4944b9c0c sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 10:12:37 +00:00
Kubernetes Publisher
f4fe69b0ee sync: update godeps 2018-03-20 06:16:04 +00:00
Kubernetes Publisher
bf928d19ad sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 06:15:42 +00:00
Kubernetes Publisher
334c327e37 sync: update godeps 2018-03-20 02:28:08 +00:00
Kubernetes Publisher
282c8d1cd4 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-20 02:27:46 +00:00
Kubernetes Publisher
099911c748 sync: update godeps 2018-03-19 22:07:21 +00:00
Kubernetes Publisher
3ce5aac867 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 22:07:01 +00:00
Kubernetes Publisher
409b230a7d sync: update godeps 2018-03-19 18:09:49 +00:00
Kubernetes Publisher
0cd0162dc6 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 18:09:27 +00:00
Kubernetes Publisher
6a72bdf75e sync: update godeps 2018-03-19 14:04:05 +00:00
Kubernetes Publisher
caef23f0d9 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 14:03:45 +00:00
Kubernetes Publisher
93527bb948 sync: update godeps 2018-03-19 10:02:38 +00:00
Kubernetes Publisher
f248b0c2a5 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 10:02:19 +00:00
Kubernetes Publisher
40d31f8ebc sync: update godeps 2018-03-19 06:03:01 +00:00
Kubernetes Publisher
a688a1ecd6 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 06:02:42 +00:00
Kubernetes Publisher
ef84932c51 sync: update godeps 2018-03-19 02:03:21 +00:00
Kubernetes Publisher
2a12a88d9a sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-19 02:03:03 +00:00
Kubernetes Publisher
253089c137 sync: update godeps 2018-03-18 22:03:37 +00:00
Kubernetes Publisher
5304c5bbfe sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-18 22:03:18 +00:00
Kubernetes Publisher
7571e5001d sync: update godeps 2018-03-18 18:03:13 +00:00
Kubernetes Publisher
eff0f430d6 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-18 18:02:54 +00:00
Kubernetes Publisher
87e1c1bd1a sync: update godeps 2018-03-18 14:02:45 +00:00
Kubernetes Publisher
cb61c988b0 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-18 14:02:26 +00:00
Kubernetes Publisher
4939cf473a sync: update godeps 2018-03-18 10:02:20 +00:00
Kubernetes Publisher
84793d4167 sync: initially remove files BUILD */BUILD BUILD.bazel */BUILD.bazel 2018-03-18 10:02:01 +00:00