Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(controller): Support int64 for param value. Fixes #4169 #4202

Merged
merged 17 commits into from
Oct 6, 2020
Next Next commit
fix(controller): Support int64 for param value. Fixes #4169
  • Loading branch information
alexec committed Oct 2, 2020
commit a06329327d8d9fceaa213f57e151c95391212917
6 changes: 3 additions & 3 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3178,7 +3178,7 @@
"properties": {
"default": {
"description": "Default is the default value to use for an input parameter if a value was not supplied",
"type": "string"
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
},
"globalName": {
"description": "GlobalName exports an output parameter to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in workflow.status.outputs.parameters",
Expand All @@ -3190,7 +3190,7 @@
},
"value": {
"description": "Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values",
"type": "string"
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
},
"valueFrom": {
"description": "ValueFrom is the source for the output parameter's value",
Expand Down Expand Up @@ -4080,7 +4080,7 @@
"properties": {
"default": {
"description": "Default specifies a value to be used if retrieving the value from the specified source fails",
"type": "string"
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
},
"event": {
"description": "Selector (https://github.com/antonmedv/expr) that is evaluated against the event to get the value of the parameter. E.g. `payload.message`",
Expand Down
4 changes: 2 additions & 2 deletions api/openapi-spec/swagger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func TestSwagger(t *testing.T) {
t.Run("io.argoproj.workflow.v1alpha1.Parameter", func(t *testing.T) {
definition := definitions["io.argoproj.workflow.v1alpha1.Parameter"].(obj)
properties := definition["properties"].(obj)
assert.Equal(t, "string", properties["default"].(obj)["type"])
assert.Equal(t, "string", properties["value"].(obj)["type"])
assert.Equal(t, "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString", properties["default"].(obj)["$ref"])
assert.Equal(t, "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString", properties["value"].(obj)["$ref"])
})
t.Run("io.argoproj.workflow.v1alpha1.Histogram", func(t *testing.T) {
definition := definitions["io.argoproj.workflow.v1alpha1.Histogram"].(obj)
Expand Down
6 changes: 3 additions & 3 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2333,10 +2333,10 @@ Parameter indicate a passed string parameter to a service template with an optio
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`default`|`string`|Default is the default value to use for an input parameter if a value was not supplied|
|`default`|[`IntOrString`](#intorstring)|Default is the default value to use for an input parameter if a value was not supplied|
|`globalName`|`string`|GlobalName exports an output parameter to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in workflow.status.outputs.parameters|
|`name`|`string`|Name is the parameter name|
|`value`|`string`|Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values|
|`value`|[`IntOrString`](#intorstring)|Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values|
|`valueFrom`|[`ValueFrom`](#valuefrom)|ValueFrom is the source for the output parameter's value|

## Prometheus
Expand Down Expand Up @@ -3634,7 +3634,7 @@ ValueFrom describes a location in which to obtain the value to a parameter
### Fields
| Field Name | Field Type | Description |
|:----------:|:----------:|---------------|
|`default`|`string`|Default specifies a value to be used if retrieving the value from the specified source fails|
|`default`|[`IntOrString`](#intorstring)|Default specifies a value to be used if retrieving the value from the specified source fails|
|`event`|`string`|Selector (https://github.com/antonmedv/expr) that is evaluated against the event to get the value of the parameter. E.g. `payload.message`|
|`jqFilter`|`string`|JQFilter expression against the resource object in resource templates|
|`jsonPath`|`string`|JSONPath of a resource to retrieve an output parameter value from in resource templates|
Expand Down
6 changes: 3 additions & 3 deletions docs/swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,10 @@ Parameter indicate a passed string parameter to a service template with an optio

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| default | string | Default is the default value to use for an input parameter if a value was not supplied | No |
| default | [io.k8s.apimachinery.pkg.util.intstr.IntOrString](#io.k8s.apimachinery.pkg.util.intstr.intorstring) | Default is the default value to use for an input parameter if a value was not supplied | No |
| globalName | string | GlobalName exports an output parameter to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in workflow.status.outputs.parameters | No |
| name | string | Name is the parameter name | Yes |
| value | string | Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values | No |
| value | [io.k8s.apimachinery.pkg.util.intstr.IntOrString](#io.k8s.apimachinery.pkg.util.intstr.intorstring) | Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values | No |
| valueFrom | [io.argoproj.workflow.v1alpha1.ValueFrom](#io.argoproj.workflow.v1alpha1.valuefrom) | ValueFrom is the source for the output parameter's value | No |

#### io.argoproj.workflow.v1alpha1.PodGC
Expand Down Expand Up @@ -1636,7 +1636,7 @@ ValueFrom describes a location in which to obtain the value to a parameter

| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| default | string | Default specifies a value to be used if retrieving the value from the specified source fails | No |
| default | [io.k8s.apimachinery.pkg.util.intstr.IntOrString](#io.k8s.apimachinery.pkg.util.intstr.intorstring) | Default specifies a value to be used if retrieving the value from the specified source fails | No |
| event | string | Selector (<https://github.com/antonmedv/expr>) that is evaluated against the event to get the value of the parameter. E.g. `payload.message` | No |
| jqFilter | string | JQFilter expression against the resource object in resource templates | No |
| jsonPath | string | JSONPath of a resource to retrieve an output parameter value from in resource templates | No |
Expand Down
75 changes: 60 additions & 15 deletions manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,17 +597,26 @@ spec:
items:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
globalName:
type: string
name:
type: string
value:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
valueFrom:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
event:
type: string
jqFilter:
Expand Down Expand Up @@ -1753,17 +1762,26 @@ spec:
items:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
globalName:
type: string
name:
type: string
value:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
valueFrom:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
event:
type: string
jqFilter:
Expand Down Expand Up @@ -2636,17 +2654,26 @@ spec:
items:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
globalName:
type: string
name:
type: string
value:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
valueFrom:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
event:
type: string
jqFilter:
Expand Down Expand Up @@ -3592,17 +3619,26 @@ spec:
items:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
globalName:
type: string
name:
type: string
value:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
valueFrom:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
event:
type: string
jqFilter:
Expand Down Expand Up @@ -4034,17 +4070,26 @@ spec:
items:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
globalName:
type: string
name:
type: string
value:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
valueFrom:
properties:
default:
type: string
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
event:
type: string
jqFilter:
Expand Down
Loading