tektoncd/operator

"options" adding resource entries on multiple installersets

jkandasa opened this issue · 0 comments

it is possible to create HPA and ConfigMap via options [1]
I was not aware of multiple installersets creation for a component at the time of options implementation.
I see, Two type of installersets [2] created for pipelines component,

  1. deployment only
  2. static - all others (except deployment)

The options transformer called two times via transformer[3].
Assume user provided a details to update a existing HPA resource.
first the transformer called with only deployments manifests,

  • checks HPA resource
  • HPA resource not available
  • Creates HPA resource and adding in that manifest (deployments manifests)

second time the transformer called with static manifests(except deployments)

  • checks HPA resource
  • HPA resource found
  • updates HPA resource on the manifest

Now we have the same HPA resource on two installersets. This leads race condition and malfunction.

[1] - https://tekton.dev/docs/operator/tektonconfig/#additional-fields-as-options
[2] -

staticManifest := manifest.Filter(mf.Not(mf.ByKind("Deployment")), mf.Not(mf.ByKind("Service")))
deploymentManifest := manifest.Filter(mf.Any(mf.ByKind("Deployment"), mf.ByKind("Service")))

[3] -
func filterAndTransform(extension common.Extension) client.FilterAndTransform {
if err := common.ExecuteAdditionalOptionsTransformer(ctx, manifest, pipeline.Spec.GetTargetNamespace(), pipeline.Spec.Options); err != nil {