Chapter 8
Sometimes, your pipeline will need to execute tasks based on certain conditions. In this chapter, you learned how to use when
expressions to add conditional flows to your pipelines. You now have the opportunity to get some experience with this concept here.
Hello Admin
Build a pipeline that will take a username as a parameter. If the username is admin
, log the Hello Admin
text. For any other username, output a simple Hello
message.
Here is a possible solution for the exercise:
apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: logger spec: params: - name: text type: string steps: - name: log image: registry.access.redhat.com/ubi8/ubi-minimal script: | DATE=$(date +%d/%m/%Y\ %T) &...