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

Clarify ParamValue syntax #6445

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions docs/api-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
- [Status Signalling](#status-signalling)
- [Listing Resources](#listing-resources)
- [Detailed Resource Types - v1beta1](#detailed-resource-types---v1beta1)
* [`ParamValue`](#paramvalue)
* [`ContainerStateRunning`](#containerstaterunning)
* [`ContainerStateWaiting`](#containerstatewaiting)
* [`ContainerStateTerminated`](#containerstateterminated)
* [`EnvVar`](#envvar)
* [`Param`](#param)
* [`ParamSpec`](#paramspec)
* [`ParamValue`](#paramvalue)
* [`Step`](#step)
* [`StepState`](#stepstate)
* [`TaskResult`](#taskresult)
Expand Down Expand Up @@ -186,15 +186,6 @@ List responses have the following fields (based on [`meta.v1/ListMeta`](https://

## Detailed Resource Types - v1beta1

### `ParamValue`

| Field Name | Field Type | Requirement |
|-------------|------------|-------------|
| `type` | Enum:<br>- `"string"` (default)<br>- `"array"` <br>- `"object"` | REQUIRED |
| `stringVal` | string | REQUIRED |
| `arrayVal` | []string | REQUIRED |
| `objectVal` | map<string,string> | REQUIRED |

### `ContainerStateRunning`

| Field Name | Field Type | Requirement |
Expand Down Expand Up @@ -236,7 +227,7 @@ List responses have the following fields (based on [`meta.v1/ListMeta`](https://
| Field Name | Field Type | Requirement |
|------------|-----------------|-------------|
| `name` | string | REQUIRED |
| `value` | `ParamValue` | REQUIRED |
| `value` | `ParamValue` | REQUIRED |

### `ParamSpec`

Expand All @@ -248,6 +239,10 @@ List responses have the following fields (based on [`meta.v1/ListMeta`](https://
| `properties` | map<string,PropertySpec> |RECOMMENDED <br><br>note: `PropertySpec` is a type that defines the spec of an individual key. See how to define the `properties` section in the [example](../examples/v1beta1/taskruns/alpha/object-param-result.yaml).|
| `default` | `ParamValue` | REQUIRED |

### `ParamValue`

A `ParamValue` may be a string, a list of string, or a map of string to string.

### `Step`

| Field Name | Field Type | Requirement |
Expand Down
16 changes: 8 additions & 8 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ Used to distinguish between a single string and an array of strings.</p>
<tbody>
<tr>
<td>
<code>type</code><br/>
<code>Type</code><br/>
<em>
<a href="#tekton.dev/v1.ParamType">
ParamType
Expand All @@ -1800,7 +1800,7 @@ ParamType
</tr>
<tr>
<td>
<code>stringVal</code><br/>
<code>StringVal</code><br/>
<em>
string
</em>
Expand All @@ -1811,7 +1811,7 @@ string
</tr>
<tr>
<td>
<code>arrayVal</code><br/>
<code>ArrayVal</code><br/>
<em>
[]string
</em>
Expand All @@ -1821,7 +1821,7 @@ string
</tr>
<tr>
<td>
<code>objectVal</code><br/>
<code>ObjectVal</code><br/>
<em>
map[string]string
</em>
Expand Down Expand Up @@ -9501,7 +9501,7 @@ Used to distinguish between a single string and an array of strings.</p>
<tbody>
<tr>
<td>
<code>type</code><br/>
<code>Type</code><br/>
<em>
<a href="#tekton.dev/v1beta1.ParamType">
ParamType
Expand All @@ -9513,7 +9513,7 @@ ParamType
</tr>
<tr>
<td>
<code>stringVal</code><br/>
<code>StringVal</code><br/>
<em>
string
</em>
Expand All @@ -9524,7 +9524,7 @@ string
</tr>
<tr>
<td>
<code>arrayVal</code><br/>
<code>ArrayVal</code><br/>
<em>
[]string
</em>
Expand All @@ -9534,7 +9534,7 @@ string
</tr>
<tr>
<td>
<code>objectVal</code><br/>
<code>ObjectVal</code><br/>
<em>
map[string]string
</em>
Expand Down
8 changes: 8 additions & 0 deletions hack/ignored-openapi-violations.list
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,SidecarState,ContainerName
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,StepState,ContainerName
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,TaskRunStatusFields,TaskRunResults
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1,ParamValue,ArrayVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1,ParamValue,ObjectVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1,ParamValue,StringVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1,ParamValue,Type
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,ParamValue,ArrayVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,ParamValue,ObjectVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,ParamValue,StringVal
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,ParamValue,Type
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1,PipelineResourceSpec,SecretParams
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,Step,DeprecatedLifecycle
API rule violation: names_match,github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1,Step,DeprecatedLivenessProbe
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/pipeline/v1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/apis/pipeline/v1/param_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,11 @@ var AllParamTypes = []ParamType{ParamTypeString, ParamTypeArray, ParamTypeObject
// Used in JSON unmarshalling so that a single JSON field can accept
// either an individual string or an array of strings.
type ParamValue struct {
Type ParamType `json:"type"` // Represents the stored type of ParamValues.
StringVal string `json:"stringVal"`
Type ParamType // Represents the stored type of ParamValues.
StringVal string
// +listType=atomic
ArrayVal []string `json:"arrayVal"`
ObjectVal map[string]string `json:"objectVal"`
ArrayVal []string
ObjectVal map[string]string
}

// UnmarshalJSON implements the json.Unmarshaller interface.
Expand Down
16 changes: 8 additions & 8 deletions pkg/apis/pipeline/v1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,33 +388,33 @@
"description": "ResultValue is a type alias of ParamValue",
"type": "object",
"required": [
"type",
"stringVal",
"arrayVal",
"objectVal"
"Type",
"StringVal",
"ArrayVal",
"ObjectVal"
],
"properties": {
"arrayVal": {
"ArrayVal": {
"type": "array",
"items": {
"type": "string",
"default": ""
},
"x-kubernetes-list-type": "atomic"
},
"objectVal": {
"ObjectVal": {
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
},
"stringVal": {
"StringVal": {
"description": "Represents the stored type of ParamValues.",
"type": "string",
"default": ""
},
"type": {
"Type": {
"type": "string",
"default": ""
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/pipeline/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/apis/pipeline/v1beta1/param_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,11 @@ var AllParamTypes = []ParamType{ParamTypeString, ParamTypeArray, ParamTypeObject
// Used in JSON unmarshalling so that a single JSON field can accept
// either an individual string or an array of strings.
type ParamValue struct {
Type ParamType `json:"type"` // Represents the stored type of ParamValues.
StringVal string `json:"stringVal"`
Type ParamType // Represents the stored type of ParamValues.
StringVal string
// +listType=atomic
ArrayVal []string `json:"arrayVal"`
ObjectVal map[string]string `json:"objectVal"`
ArrayVal []string
ObjectVal map[string]string
}

// ArrayOrString is deprecated, this is to keep backward compatibility
Expand Down
16 changes: 8 additions & 8 deletions pkg/apis/pipeline/v1beta1/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -647,33 +647,33 @@
"description": "ResultValue is a type alias of ParamValue",
"type": "object",
"required": [
"type",
"stringVal",
"arrayVal",
"objectVal"
"Type",
"StringVal",
"ArrayVal",
"ObjectVal"
],
"properties": {
"arrayVal": {
"ArrayVal": {
"type": "array",
"items": {
"type": "string",
"default": ""
},
"x-kubernetes-list-type": "atomic"
},
"objectVal": {
"ObjectVal": {
"type": "object",
"additionalProperties": {
"type": "string",
"default": ""
}
},
"stringVal": {
"StringVal": {
"description": "Represents the stored type of ParamValues.",
"type": "string",
"default": ""
},
"type": {
"Type": {
"type": "string",
"default": ""
}
Expand Down