Tekton is an open-source framework for creating CI/CD systems. It provides Kubernetes-style resources for declaring CI/CD-style pipelines. Tekton allows developers to build, test, and deploy across cloud providers or on-premise systems.
When working with Tekton, you might encounter an error message stating: PipelineRun validation failed
. This error indicates that there is an issue with the specification of your PipelineRun resource.
The error message typically appears in the logs or the output of your Tekton CLI commands, and it might look something like this:
Error from server (BadRequest): error when creating "pipelinerun.yaml": admission webhook "webhook.tekton.dev" denied the request: validation failed: ...
The PipelineRun validation failed
error occurs when the specification of a PipelineRun does not meet the required validation checks. This could be due to incorrect field values, missing required fields, or mismatches between the PipelineRun and the referenced Pipeline or Task definitions.
To resolve the PipelineRun validation failed
error, follow these steps:
Carefully read the error message provided by Tekton. It often contains specific details about what part of the spec is invalid. This can guide you to the exact field or section that needs correction.
Ensure that your PipelineRun spec adheres to the Tekton API specifications. You can refer to the Tekton PipelineRun documentation for detailed information on the required fields and their formats.
Verify that all resources referenced in your PipelineRun exist and are correctly defined. This includes checking for correct names and types of resources.
Utilize the Tekton CLI to validate your PipelineRun spec before applying it. You can use commands like:
tkn pipelinerun describe
This command helps you inspect the PipelineRun and ensure all references are correct.
Based on the findings from the above steps, correct the PipelineRun spec. Ensure all required fields are present and correctly formatted. Reapply the corrected spec using:
kubectl apply -f pipelinerun.yaml
By following these steps, you should be able to resolve the PipelineRun validation failed
error. For further assistance, consider visiting the Tekton Community for support and additional resources.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo