pipelines-as-code
pipelines-as-code copied to clipboard
Remove kind ClusterTask from generic template
Issue
tkn-pac generate
uses generic template and it used to have kind: ClusterTask
so when we push those changes Pipelinerun use to fail with error CouldNotGetTask
Warning Failed 25s (x2 over 25s) PipelineRun Pipeline article-pipelines/article-pull-request-qjpsq can't be Run; it contains Tasks that don't exist: Couldn't retrieve Task "git-clone": clustertasks.tekton.dev "git-clone" not found
Normal FinalizerUpdate 25s pipelinerun-controller Updated "article-pull-request-qjpsq" finalizers
Warning Error 25s PipelineRun Operation cannot be fulfilled on pipelineruns.tekton.dev "article-pull-request-qjpsq": the object has been modified; please apply your changes to the latest version and try again
Warning InternalError 25s PipelineRun 2 errors occurred:
* Couldn't retrieve Task "git-clone": clustertasks.tekton.dev "git-clone" not found
* Operation cannot be fulfilled on pipelineruns.tekton.dev "article-pull-request-qjpsq": the object has been modified; please apply your changes to the latest version and try again
Warning InternalError 25s PipelineRun 1 error occurred:
* Couldn't retrieve Task "git-clone": clustertasks.tekton.dev "git-clone" not found
Changes
- Removed
kind: ClusterTask
from generic.yaml
Submitter Checklist
- [ ] โฝ Run
make test lint
before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI - [ ] ๐ If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
- [ ] ๐งช 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
- [ ] ๐ If that's something that is possible to do please ensure to check if we can add a e2e test.
- [ ] ๐ If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).
/hold
I think it's needed for when we ship on openshift-console since they fetch the template as is
maybe we should just strings.Replace them as we do here :
https://github.com/openshift-pipelines/pipelines-as-code/blob/main/pkg/cmd/tknpac/generate/template.go#L88-L95
unless https://github.com/openshift-pipelines/pipelines-as-code/blob/main/pkg/cmd/tknpac/generate/generate.go#L102-L103 is set to true (which gets autodetected if not specified)
Closing this because we have done that change intentionally to handle for Openshift