Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ include::modules/op-disabling-the-integretion-of-tekton-hub.adoc[leveloffset=+1]

include::modules/op-disabling-automatic-creation-of-rbac-resources.adoc[leveloffset=+1]

include::modules/op-disabling-inline-spec.adoc[leveloffset=+1]

include::modules/op-automatic-pruning-taskrun-pipelinerun.adoc[leveloffset=+1]

include::modules/op-default-pruner-configuration.adoc[leveloffset=+2]
Expand Down
85 changes: 85 additions & 0 deletions modules/op-disabling-inline-spec.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// This module is included in the following assemblies:
// * install_config/customizing-configurations-in-the-tektonconfig-cr.adoc

:_mod-docs-content-type: CONCEPT
[id="op-disabling-inline-spec_{context}"]
= Disabling inline specification of pipelines and tasks

By default, {pipelines-shortname} supports inline specification of pipelines and tasks in the following cases:

* You can create a `Pipeline` CR that includes one or more task specifications, as in the following example:
+
.Example of an inline specification in a `Pipeline` CR
[source,yaml]
----
apiVersion: operator.tekton.dev/v1
kind: Pipeline
metadata:
name: pipelineInline
spec:
tasks:
taskSpec:
# ...
----

* You can create a `PipelineRun` custom resource (CR) that includes a pipeline specification, as in the following example:
+
.Example of an inline specification in a `PipelineRun` CR
[source,yaml]
----
apiVersion: operator.tekton.dev/v1
kind: PipelineRun
metadata:
name: pipelineRunInline
spec:
pipelineSpec:
tasks:
# ...
----

* You can create a `TaskRun` custom resource (CR) that includes a task specification, as in the following example:
+
.Example of an inline specification in a `TaskRun` CR
[source,yaml]
----
apiVersion: operator.tekton.dev/v1
kind: TaskRun
metadata:
name: taskRunInline
spec:
taskSpec:
steps:
# ...
----

You can disable inline specification in some or all of these cases. To disable the inline specification, set the `disable-inline-spec` field of the `.spec.pipeline` specification of the `TektonConfig` CR, as in the following example:

.Example configuration that disables inline specification
[source,yaml]
----
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
spec:
pipeline:
disable-inline-spec: "pipeline,pipelinerun,taskrun"
# ...
----

You can set the `disable-inline-spec` parameter to any single value or to a comma-separated list of multiple values. The following values for the parameter are valid:

.Supported values for the `disable-inline-spec` parameter
|===
| Value | Description

|`pipeline`
|You cannot use a `taskSpec:` spec to define a task inside a `Pipeline` CR. Instead, you must use a `taskRef:` spec to incorporate a task from a `Task` CR or to specify a task using a resolver.

|`pipelinerun`
|You cannot use a `pipelineSpec:` spec to define a pipeline inside a `PipelineRun` CR. Instead, you must use a `pipelineRef:` spec to incorporate a pipeline from a `Pipeline` CR or to specify a pipeline using a resolver.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khrm what happens when I set disable-inline-spec: "pipeline" ... will I be able to use taskSpec inside pipelinerun?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Setting pipeline only disables setting taskSpec and pipelineSpec in the Pipeline resource.


|`taskrun`
|You cannot use a `taskSpec:` spec to define a task inside a `TaskRun` CR. Instead, you must use a `taskRef:` spec to incorporate a task from a `Task` CR or to specify a task using a resolver.

|===