-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Allow Task Authors specify a Param Allowed List #7084
Comments
/cc @tektoncd/core-maintainers |
+1 to improving the schema for params consider naming the field apiVersion: tekton.dev/v1
kind: Task
metadata:
name: demo
spec:
Params:
- name: identifier
type: string
enum:
- "sha256:foo"
- "sha256:bar"
- "sha256:baz"
steps:
- name: s1
image: gcr.io/kaniko/executor@$(params.identifier) @skaegi had previously proposed the |
cc @pritidesai as discussed in data interface wg |
This is a good suggestion. We could also consider to introduce another layer named apiVersion: tekton.dev/v1
kind: Task
metadata:
name: demo
spec:
Params:
- name: identifier
type: string
constrains:
enum:
- "sha256:foo"
- "sha256:bar"
- "sha256:baz"
# cel: "some cel expression"
# regex: "some regular expression"
steps:
- name: s1
image: gcr.io/kaniko/executor@$(params.identifier) However, we could focus on the |
Generate TEP142: Param Allowlist Context: tektoncd/pipeline#7084 Signed-off-by: Chuang Wang <chuangw@google.com>
Feature request
Today, Tekton does not have a native way to validate param input values. As a workaround, Task authors need to create extra validation tasks/steps, or embed the param input validation in the script.
A Task Author should be able to specify a list of allowed values for the param.
At runtime, the Tekton Controller checks the user provided param value against the corresponding allowed values defined by the Task Author. The Tekton Controller passes the validation if the user-provided value is in the allowed list, it fails the validation otherwise.
Proposal
One solution is to introduce a new
allowed
API field underspec.param
e.g.Ideally, the param allowlist should be able to take CEL or Regular expressions.
Use case
storageClass
values In gcs-create-bucket.yaml.The text was updated successfully, but these errors were encountered: