Skip to content

Commit

Permalink
Deprecated implicit parameters
Browse files Browse the repository at this point in the history
Tekton Pipelines resources are verbose mostly because of explicitly propagating Parameters. Implicit Parameters feature was added to reduce the verbosity. However, there are challenges caused by mutating specifications to support Implicit Parameters. This PR deprecates existing implementation of implicit parameters. A followup PR will address improvements to this and allow propagating paramaters that the task requires.
  • Loading branch information
chitrangpatel authored and tekton-robot committed May 25, 2022
1 parent a67eee4 commit e24df83
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 1,082 deletions.
70 changes: 0 additions & 70 deletions docs/pipelineruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ weight: 500
- [Remote Pipelines](#remote-pipelines)
- [Specifying <code>Resources</code>](#specifying-resources)
- [Specifying <code>Parameters</code>](#specifying-parameters)
- [Implicit Parameters](#implicit-parameters)
- [Specifying custom <code>ServiceAccount</code> credentials](#specifying-custom-serviceaccount-credentials)
- [Mapping <code>ServiceAccount</code> credentials to <code>Tasks</code>](#mapping-serviceaccount-credentials-to-tasks)
- [Specifying a <code>Pod</code> template](#specifying-a-pod-template)
Expand Down Expand Up @@ -284,75 +283,6 @@ case is when your CI system autogenerates `PipelineRuns` and it has `Parameters`
provide to all `PipelineRuns`. Because you can pass in extra `Parameters`, you don't have to
go through the complexity of checking each `Pipeline` and providing only the required params.

#### Implicit Parameters

**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/install.md#alpha-features))**

When using an inlined spec, parameters from the parent `PipelineRun` will be
available to any inlined specs without needing to be explicitly defined. This
allows authors to simplify specs by automatically propagating top-level
parameters down to other inlined resources.

```yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: echo-
spec:
params:
- name: MESSAGE
value: "Good Morning!"
pipelineSpec:
tasks:
- name: echo-message
taskSpec:
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "$(params.MESSAGE)"
```

On creation, this will resolve to a fully-formed spec and will be returned back
to clients to avoid ambiguity:

```yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: echo-
spec:
params:
- name: MESSAGE
value: Good Morning!
pipelineSpec:
params:
- name: MESSAGE
type: string
tasks:
- name: echo-message
params:
- name: MESSAGE
value: $(params.MESSAGE)
taskSpec:
params:
- name: MESSAGE
type: string
spec: null
steps:
- name: echo
image: ubuntu
script: |
#!/usr/bin/env bash
echo "$(params.MESSAGE)"
```

Note that all implicit Parameters will be passed through to inlined resources
(i.e. PipelineRun -> Pipeline -> Tasks) even if they are not used.
Extra parameters passed this way should generally be safe (since they aren't
actually used), but may result in more verbose specs being returned by the API.

### Specifying custom `ServiceAccount` credentials

You can execute the `Pipeline` in your `PipelineRun` with a specific set of credentials by
Expand Down
55 changes: 0 additions & 55 deletions docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ weight: 300
- [Tekton Bundles](#tekton-bundles)
- [Remote Tasks](#remote-tasks)
- [Specifying `Parameters`](#specifying-parameters)
- [Implicit Parameters](#implicit-parameters)
- [Extra Parameters](#extra-parameters)
- [Specifying `Resources`](#specifying-resources)
- [Specifying `Resource` limits](#specifying-resource-limits)
Expand Down Expand Up @@ -198,60 +197,6 @@ spec:

**Note:** If a parameter does not have an implicit default value, you must explicitly set its value.

#### Implicit Parameters

**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/install.md#alpha-features))**

When using an inlined `taskSpec`, parameters from the parent `TaskRun` will be
available to the `Task` without needing to be explicitly defined.

```yaml
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
generateName: hello-
spec:
params:
- name: message
value: "hello world!"
taskSpec:
# There are no explicit params defined here.
# They are derived from the TaskRun params above.
steps:
- name: default
image: ubuntu
script: |
echo $(params.message)
```

On creation, this will resolve to a fully-formed spec and will be returned back
to clients to avoid ambiguity:

```yaml
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
generateName: hello-
spec:
params:
- name: message
value: "hello world!"
taskSpec:
params:
- name: message
type: string
steps:
- name: default
image: ubuntu
script: |
echo $(params.message)
```

Note that all implicit Parameters will be passed through to inlined resource,
even if they are not used. Extra parameters passed this way should generally
be safe (since they aren't actually used), but may result in more verbose specs
being returned by the API.

#### Extra Parameters

**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/install.md#alpha-features))**
Expand Down

This file was deleted.

15 changes: 0 additions & 15 deletions examples/v1beta1/taskruns/alpha/implicit-params.yaml

This file was deleted.

Loading

0 comments on commit e24df83

Please sign in to comment.