We received a use case from our users about pipeline templating. The users want to use var for tags, like:
- task: some-task
tags: [((worker-tag))]
...
Then the var will be given from a var file as:
worker-tag: "a"
which works properly to direct the task to a "a" worker.
But if task needs to go to the default worker pool, specifying
worker-tag: ""
doesn't work. The error is no workers satisfying: resource type 'registry-image', platform 'linux', tag ''
tags: [""] to a task.We expect the empty tag "" to be considered as null tag, and be ignored.
"" is considered as a meaning tag, thus cannot match to any worker.
Would an acceptable alternative be to specify the array?:
tags: ((worker_tags))
+
worker_tags: []
I just tried, that works.
@vito this is a great solution. I think this might be a helpful tip to put in the documentation somewhere.
Most helpful comment
I just tried, that works.