pipelines-as-code icon indicating copy to clipboard operation
pipelines-as-code copied to clipboard

Remove kind ClusterTask from generic template

Open savitaashture opened this issue 1 year ago โ€ข 2 comments

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).

savitaashture avatar Aug 04 '22 08:08 savitaashture

/hold

savitaashture avatar Aug 09 '22 10:08 savitaashture

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)

chmouel avatar Sep 01 '22 09:09 chmouel

Closing this because we have done that change intentionally to handle for Openshift

savitaashture avatar Sep 02 '22 08:09 savitaashture