You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support boolean parameter or that a string parameter is converted into a boolean. Ideally we should have a collection of functions able to perform $(params.PRIVILEGED | toBoolean)
Use case
Tekton don't propose a way to define a boolean parameter or to convert a string parameter to a boolean as this is needed to configure the following field: pod > securityContext > privileged: true
The only working solution implied to duplicate the code of the task which is a bit boring and to use when
Example:
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
name: pr-echo
spec:
params:
- name: HELLO
value: "Hello World!"
- name: BYE
value: "Bye World!"
- name: PRIVILEGED
value: false
pipelineSpec:
tasks:
- name: echo-privileged-true
when:
- input: "$(params.PRIVILEGED)"
operator: in
values: [ "true" ]
taskSpec:
steps:
- name: echo-privileged-true
image: ubuntu
script: |
#!/usr/bin/env bash
echo "The value of the param PRIVILEGED is: $(params.PRIVILEGED)"
echo "$(params.HELLO)"
securityContext:
privileged: true
- name: echo-privileged-false
when:
- input: "$(params.PRIVILEGED)"
operator: in
values: [ "false" ]
taskSpec:
steps:
- name: echo-privileged-false
image: ubuntu
script: |
#!/usr/bin/env bash
echo "The value of the param PRIVILEGED is: $(params.PRIVILEGED)"
echo "$(params.HELLO)"
securityContext:
privileged: false
The text was updated successfully, but these errors were encountered:
Feature request
Support boolean parameter or that a string parameter is converted into a boolean. Ideally we should have a collection of functions able to perform
$(params.PRIVILEGED | toBoolean)
Use case
Tekton don't propose a way to define a boolean parameter or to convert a string parameter to a boolean as this is needed to configure the following field:
pod > securityContext > privileged: true
The only working solution implied to duplicate the code of the task which is a bit boring and to use
when
Example:
The text was updated successfully, but these errors were encountered: