Add possibility to nicely render and edit multiline strings in Tekton Dashboard GUI for TaskRun specs
Feature request
Add possibility to nicely render and edit multiline strings in Tekton Dashboard GUI for TaskRun specs. Currently it is hard to pass and process multiline strings and arrays in Tekton Dashboard TaskRun parameters (which are added automatically from selected Task).
Use case
We specify k8s command (array type), tolerations (string type) and affinity (string type) as Task parameters, from gitops side it looks ok. But if we need to edit it in Tekton Dashboard GUI, it becomes very hard and not user friendly
Alternatives
It would be great if multiline string params look like multilines in Tekton Dashboard GUI too.
Additional context
apiVersion: tekton.dev/v1
kind: Task
metadata:
name: test
namespace: test
spec:
description: The test task
params:
- default: |
- bash
- -c
- |
sleep infinity
name: command
type: string
- default: |
- effect: NoSchedule
key: workload
operator: Equal
value: test
name: tolerations
type: string
- default: |
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: workload
operator: In
values:
- test
name: affinity
type: string
steps:
- env:
- name: COMMAND
value: $(params.command)
- name: TOLERATIONS_YAML
value: $(params.tolerations)
- name: AFFINITY_YAML
value: $(params.affinity)
image: bash:latest
imagePullPolicy: Always
name: test
script: |
#!/usr/bin/env bash
echo "Hello world"
securityContext:
allowPrivilegeEscalation: false
privileged: false
runAsNonRoot: true
Thanks for the feature request, this makes sense as an enhancement. Array param support is already being tracked in https://github.com/tektoncd/dashboard/issues/2171 and there's a related issue tracking enum support: https://github.com/tektoncd/dashboard/issues/3901
We'll keep this issue just for the multiline string support.
It probably makes sense to tackle these 3 issues together as they're all in the same area and will likely require an overhaul of the form-based create UI.
This turned out to be much simpler than expected. All of the underlying support was already in place, it was a purely UI problem where it was using a single line text input instead of a multiline text area.
#4366 open to address this and should be included in v0.61 later this month.