Question 1
IntermediateWork with OpenShift Pipelines · Design and define, and troubleshoot CI/CD workflows for applications
You are configuring a Red Hat OpenShift Pipeline (Tekton) to build and deploy a Java application. The pipeline consists of two tasks: build-app (which compiles the code using Maven) and build-image (which uses Buildah to create a container image). The build-app task produces a JAR file that the build-image task requires. However, the build-image task fails immediately, stating the JAR file cannot be found. You have verified the JAR is successfully created in the first task.
Which configuration is required to persist and share files between these two tasks?
Answer and explanation
Correct answer: A
In Tekton/OpenShift Pipelines, tasks run in separate pods. The filesystem is not shared by default. To share artifacts (like a compiled JAR) between tasks, you must define a Workspace in the Pipeline definition and bind it to a storage volume (like a PVC) at runtime via the PipelineRun. Both tasks then mount this workspace to read/write shared files.
