From 9512e78dc6d78d919b8f534350830906c7fadf3a Mon Sep 17 00:00:00 2001 From: Kenny Trytek Date: Sun, 14 Feb 2021 16:41:57 -0600 Subject: [PATCH] fix: Invalid OpenAPI Spec (Issue 4817) Signed-off-by: Kenny Trytek --- api/jsonschema/schema.json | 5 +---- api/openapi-spec/swagger.json | 5 +---- examples/daemon-nginx.yaml | 2 +- examples/daemon-step.yaml | 2 +- examples/dag-daemon-task.yaml | 2 +- examples/dag-disable-failFast.yaml | 6 +++--- examples/default-pdb-support.yaml | 2 +- examples/influxdb-ci.yaml | 2 +- examples/retry-backoff.yaml | 4 ++-- examples/retry-container.yaml | 2 +- examples/retry-on-error.yaml | 2 +- examples/retry-script.yaml | 2 +- examples/retry-with-steps.yaml | 2 +- hack/swagger/kubeifyswagger.go | 2 +- 14 files changed, 17 insertions(+), 23 deletions(-) diff --git a/api/jsonschema/schema.json b/api/jsonschema/schema.json index 8fa15127a1ff..9cecccd0df10 100644 --- a/api/jsonschema/schema.json +++ b/api/jsonschema/schema.json @@ -8636,10 +8636,7 @@ "type": "string" }, "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { - "type": [ - "string", - "integer" - ] + "type": "string" }, "sensor.CreateSensorRequest": { "properties": { diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index ccc1a2ff81f7..7d128c2eb123 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -12044,10 +12044,7 @@ "format": "date-time" }, "io.k8s.apimachinery.pkg.util.intstr.IntOrString": { - "type": [ - "string", - "integer" - ] + "type": "string" }, "sensor.CreateSensorRequest": { "type": "object", diff --git a/examples/daemon-nginx.yaml b/examples/daemon-nginx.yaml index 4ad13e03d97b..1b20e147c5ca 100644 --- a/examples/daemon-nginx.yaml +++ b/examples/daemon-nginx.yaml @@ -24,7 +24,7 @@ spec: readinessProbe: httpGet: path: / - port: 80 + port: "80" initialDelaySeconds: 2 timeoutSeconds: 1 diff --git a/examples/daemon-step.yaml b/examples/daemon-step.yaml index 14f9e0c6f869..1770f7560251 100644 --- a/examples/daemon-step.yaml +++ b/examples/daemon-step.yaml @@ -50,7 +50,7 @@ spec: readinessProbe: httpGet: path: /ping - port: 8086 + port: "8086" initialDelaySeconds: 5 timeoutSeconds: 1 diff --git a/examples/dag-daemon-task.yaml b/examples/dag-daemon-task.yaml index e16637961692..f63e6709c6a0 100644 --- a/examples/dag-daemon-task.yaml +++ b/examples/dag-daemon-task.yaml @@ -59,7 +59,7 @@ spec: readinessProbe: httpGet: path: /ping - port: 8086 + port: "8086" initialDelaySeconds: 5 timeoutSeconds: 1 diff --git a/examples/dag-disable-failFast.yaml b/examples/dag-disable-failFast.yaml index 683c990a1939..b7a57d601638 100644 --- a/examples/dag-disable-failFast.yaml +++ b/examples/dag-disable-failFast.yaml @@ -12,14 +12,14 @@ spec: args: ["hello world"] - name: b retryStrategy: - limit: 2 + limit: "2" container: image: alpine:latest command: [sh, -c] args: ["sleep 30; echo haha"] - name: c retryStrategy: - limit: 3 + limit: "3" container: image: alpine:latest command: [sh, -c] @@ -46,4 +46,4 @@ spec: template: d - name: E dependencies: [D] - template: d \ No newline at end of file + template: d diff --git a/examples/default-pdb-support.yaml b/examples/default-pdb-support.yaml index 86b0a5c31e6a..8fcbb2ffb379 100644 --- a/examples/default-pdb-support.yaml +++ b/examples/default-pdb-support.yaml @@ -7,7 +7,7 @@ spec: entrypoint: pdbcreate serviceAccountName: default podDisruptionBudget: - minAvailable: 9999 # Provide arbitrary big number if you don't know how many pods workflow creates + minAvailable: "9999" # Provide arbitrary big number if you don't know how many pods workflow creates templates: - name: pdbcreate container: diff --git a/examples/influxdb-ci.yaml b/examples/influxdb-ci.yaml index 4b6b865d09a7..609438bb43bd 100644 --- a/examples/influxdb-ci.yaml +++ b/examples/influxdb-ci.yaml @@ -203,7 +203,7 @@ spec: readinessProbe: httpGet: path: /ping - port: 8086 + port: "8086" initialDelaySeconds: 5 timeoutSeconds: 1 command: ["/bin/sh", "-c"] diff --git a/examples/retry-backoff.yaml b/examples/retry-backoff.yaml index 234f462f4bf1..294b9fc8a027 100644 --- a/examples/retry-backoff.yaml +++ b/examples/retry-backoff.yaml @@ -8,10 +8,10 @@ spec: templates: - name: retry-backoff retryStrategy: - limit: 10 + limit: "10" backoff: duration: "1" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d" - factor: 2 + factor: "2" maxDuration: "1m" # Must be a string. Default unit is seconds. Could also be a Duration, e.g.: "2m", "6h", "1d" container: image: python:alpine3.6 diff --git a/examples/retry-container.yaml b/examples/retry-container.yaml index 3ca0657d5a6b..95cab3c9bfbe 100644 --- a/examples/retry-container.yaml +++ b/examples/retry-container.yaml @@ -8,7 +8,7 @@ spec: templates: - name: retry-container retryStrategy: - limit: 10 + limit: "10" container: image: python:alpine3.6 command: ["python", -c] diff --git a/examples/retry-on-error.yaml b/examples/retry-on-error.yaml index 12411ee5c6b2..d1d052d980c3 100644 --- a/examples/retry-on-error.yaml +++ b/examples/retry-on-error.yaml @@ -8,7 +8,7 @@ spec: templates: - name: error-container retryStrategy: - limit: 2 + limit: "2" retryPolicy: "Always" # Retry on errors AND failures. Also available: "OnFailure" (default), "OnError" container: image: python diff --git a/examples/retry-script.yaml b/examples/retry-script.yaml index 616f7939283e..92bc489d0fe7 100644 --- a/examples/retry-script.yaml +++ b/examples/retry-script.yaml @@ -8,7 +8,7 @@ spec: templates: - name: retry-script retryStrategy: - limit: 10 + limit: "10" script: image: python:alpine3.6 command: ["python"] diff --git a/examples/retry-with-steps.yaml b/examples/retry-with-steps.yaml index a6bfcd4f5bb3..c720df3640c2 100644 --- a/examples/retry-with-steps.yaml +++ b/examples/retry-with-steps.yaml @@ -16,7 +16,7 @@ spec: template: random-fail - name: random-fail retryStrategy: - limit: 10 + limit: "10" container: image: python:alpine3.6 command: [python, -c] diff --git a/hack/swagger/kubeifyswagger.go b/hack/swagger/kubeifyswagger.go index cc68c626965e..744d78195ef4 100644 --- a/hack/swagger/kubeifyswagger.go +++ b/hack/swagger/kubeifyswagger.go @@ -59,7 +59,7 @@ func kubeifySwagger(in, out string) { } } - definitions["io.k8s.apimachinery.pkg.util.intstr.IntOrString"] = obj{"type": array{"string", "integer"}} + definitions["io.k8s.apimachinery.pkg.util.intstr.IntOrString"] = obj{"type": "string"} // "omitempty" does not work for non-nil structs, so we must change it here definitions["io.argoproj.workflow.v1alpha1.CronWorkflow"].(obj)["required"] = array{"metadata", "spec"} definitions["io.argoproj.workflow.v1alpha1.Workflow"].(obj)["required"] = array{"metadata", "spec"}