Skip to content

Commit 7827245

Browse files
authored
Merge pull request #84484 from eromanova97/RHDEVDOCS-6249
RHDEVDOCS-6249: Add support for step actions in cluster resolver
2 parents 02eac1c + 1be09a9 commit 7827245

File tree

3 files changed

+43
-30
lines changed

3 files changed

+43
-30
lines changed

create/remote-pipelines-tasks-resolvers.adoc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,11 @@ Hub resolver:: Retrieves a task, pipeline, or `StepAction` definition from the P
2020
Bundles resolver:: Retrieves a task, pipeline, or `StepAction` definition from a Tekton bundle, which is an OCI image available from any OCI repository, such as an OpenShift container repository.
2121
Git resolver:: Retrieves a task, pipeline, or `StepAction` definition from a Git repository. You must specify the repository, the branch, and the path.
2222
HTTP resolver:: Retrieves a task, pipeline, or `StepAction` definition from a remote HTTP or HTTPS URL. You must specify the URL for authentication.
23-
Cluster resolver:: Retrieves a task or pipeline that is already created on the same {OCP} cluster in a specific namespace.
24-
+
25-
[NOTE]
26-
====
27-
In {pipelines-shortname} version {pipelines-version-number}, the cluster resolver does not support retrieving `StepAction` definitions.
28-
====
23+
Cluster resolver:: Retrieves a task, pipeline, or `StepAction` definition that is already created on the same {OCP} cluster in a specific namespace.
2924

3025
An {pipelines-shortname} installation includes a set of standard tasks that you can use in your pipelines. These tasks are located in the {pipelines-shortname} installation namespace, which is normally the `openshift-pipelines` namespace. You can use the cluster resolver to access the tasks.
3126

32-
{pipelines-shortname} also provides a standard `StepAction` definition. You can use the HTTP resolver to access this definition.
27+
{pipelines-shortname} also provides a standard `StepAction` definition. You can use the cluster resolver to access this definition.
3328

3429
[id="resolver-hub_{context}"]
3530
== Specifying a remote pipeline, task, or step action from a Tekton catalog
@@ -77,9 +72,9 @@ include::modules/op-resolver-http-config.adoc[leveloffset=+2]
7772
include::modules/op-resolver-http.adoc[leveloffset=+2]
7873

7974
[id="resolver-cluster_{context}"]
80-
== Specifying a pipeline or task from the same cluster
75+
== Specifying a pipeline, task, or step action from the same cluster
8176

82-
You can use the cluster resolver to specify a pipeline or task that is defined in a namespace on the {OCP} cluster where {pipelines-title} is running.
77+
You can use the cluster resolver to specify a pipeline, task, or `StepAction` definition that is defined in a namespace on the {OCP} cluster where {pipelines-title} is running.
8378

8479
In particular, you can use the cluster resolver to access tasks that {pipelines-shortname} provides in its installation namespace, which is normally the `openshift-pipelines` namespace.
8580

modules/op-resolver-cluster.adoc

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
// // *openshift_pipelines/remote-pipelines-tasks-resolvers.adoc
55
:_mod-docs-content-type: PROCEDURE
66
[id="resolver-cluster-specify_{context}"]
7-
= Specifying a pipeline or task from the same cluster using the cluster resolver
7+
= Specifying a pipeline, task, or step action from the same cluster using the cluster resolver
88

9-
When creating a pipeline run, you can specify a pipeline that exists on the same cluster. When creating a pipeline or a task run, you can specify a task that exists on the the same cluster.
9+
When creating a pipeline run, you can specify a pipeline that exists on the same cluster. When creating a pipeline or a task run, you can specify a task that exists on the the same cluster. When creating a step within a task, you can specify a `StepAction` definition that exists on the the same cluster.
1010

1111
.Procedure
1212

13-
* To specify a pipeline or task from the same cluster, use the following reference format in the `pipelineRef` or `taskRef` spec:
13+
* To specify a pipeline, task, or `StepAction` definition from the same cluster, use the following reference format in the `pipelineRef`, `taskRef`, or `step.ref` spec:
1414
+
1515
[source,yaml]
1616
----
@@ -22,7 +22,7 @@ When creating a pipeline run, you can specify a pipeline that exists on the same
2222
- name: namespace
2323
value: <namespace>
2424
- name: kind
25-
value: [pipeline|task]
25+
value: [pipeline|task|stepaction]
2626
# ...
2727
----
2828
+
@@ -118,3 +118,28 @@ spec:
118118
- name: sample-task-parameter
119119
value: test
120120
----
121+
122+
The following example task includes a step that references a `StepAction` definition from the same cluster:
123+
124+
[source,yaml]
125+
----
126+
apiVersion: tekton.dev/v1
127+
kind: Task
128+
metadata:
129+
name: cluster-stepaction-reference-demo
130+
spec:
131+
steps:
132+
- name: example-step
133+
ref:
134+
resolver: cluster
135+
params:
136+
- name: name
137+
value: some-step
138+
- name: namespace
139+
value: test-namespace
140+
- name: kind
141+
value: stepaction
142+
params:
143+
- name: sample-stepaction-parameter
144+
value: test
145+
----

modules/op-resolver-stepactions-ref.adoc

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@
66
[id="resolver-stepactions-ref_{context}"]
77
= Step action provided with {pipelines-shortname}
88

9-
{pipelines-shortname} provides a standard `StepAction` definition that you can use in your tasks. Use the HTTP resolver to reference this definition.
9+
{pipelines-shortname} provides a standard `StepAction` definition that you can use in your tasks. Use the cluster resolver to reference this definition.
1010

1111
[discrete]
1212
[id="op-stepaction-git-clone_{context}"]
1313
== git-clone
1414

1515
The `git-clone` step action uses Git to initialize and clone a remote repository on a workspace. You can use this step action to define a task that clones a repository at the start of a pipeline that builds or otherwise processes this source code.
1616

17-
To reference this step action in a task, use the HTTP resolver with the following URL:
18-
19-
[source,text]
20-
----
21-
https://raw.githubusercontent.com/openshift-pipelines/tektoncd-catalog/p/stepactions/stepaction-git-clone/0.4.1/stepaction-git-clone.yaml
22-
----
2317

2418
.Example usage of the `git-clone` step action in a task
2519
[source,yaml,subs="attributes+"]
@@ -29,19 +23,18 @@ kind: Task
2923
metadata:
3024
name: clone-repo-anon
3125
spec:
32-
params:
33-
- name: url
34-
description: The URL of the Git repository to clone
35-
workspaces:
36-
- name: output
37-
description: The git repo will be cloned onto the volume backing this Workspace.
26+
# ...
3827
steps:
39-
- name: clone-repo-anon-step
28+
- name: clone-repo-step
4029
ref:
41-
resolver: http
30+
resolver: cluster
4231
params:
43-
- name: url
44-
value: https://raw.githubusercontent.com/openshift-pipelines/tektoncd-catalog/p/stepactions/stepaction-git-clone/0.4.1/stepaction-git-clone.yaml
32+
- name: name
33+
value: git-clone
34+
- name: namespace
35+
value: openshift-pipelines
36+
- name: kind
37+
value: stepaction
4538
params:
4639
- name: URL
4740
value: $(params.url)

0 commit comments

Comments
 (0)