Add Custom Task Images to Selector
This guide explains how to configure selector options for the image parameter in the UI Task form, covering two scenarios:
- Adding images for hub Tasks
- Adding images for your own namespace Tasks.
TOC
Feature Overview
- Each selector option comes from a
ConfigMapwithdata.name(label) anddata.image(value). - Task-specific labels (for example,
catalog.tekton.dev/tool-image-python) make the UI matchConfigMapsto the rightTaskparameter. - The UI queries the namespace specified in the
Taskannotation (for example,kube-public) using the label selector defined in theTaskdescriptor, then renders the selector with the results.
Use Cases
- Add an customize registry mirror image for a
Taskselector. - Introduce a new runtime minor alongside existing selector options.
- Provide a hardened image option for a custom
Task.
Prerequisites
- Tekton Pipelines is installed.
- You can create
ConfigMapsinkube-public. - You can set
style.tekton.dev/descriptorson the targetTask(Hub Tasksalready provide it; customTasksneed you to add it).
Scenario A: Add images to a Hub Task selector
Use this path when extending the selector of a Hub Task.
1. Find the label selector from the Task descriptor
Locate the style.tekton.dev/descriptors annotation on the Task and find the entry whose path points to the image
parameter.
The descriptor ending with urn:alm:descriptor:expression:props.options:api includes a labelSelector=... query; the
label key there must be present on your ConfigMap.
In the following example, you need to create a ConfigMap with the catalog.tekton.dev/tool-image-python label in the
kube-public namespace.
For more information of style.tekton.dev/descriptors, see How to Configure Dynamic Forms.
2. Create a ConfigMap in kube-public
Create a ConfigMap using that label key.
Default Tasks ship
ConfigMapslabeledcatalog.tekton.dev/source: systemto indicate platform-provided entries. Do not modify or delete those, and your customConfigMapsshould not include this label.
3. Apply and verify
Open the Task form; the selector should now include Python 3.10 and set the image to
registry.example.com/tekton/python:3.10.
Scenario B: Add images to your own Task selector
Use this path when you control the Task definition and need to configure descriptors plus ConfigMaps.
1. Configure style.tekton.dev/descriptors on the Task
Example Task descriptor for an image selector:
Descriptor items and meanings:
For more information of style.tekton.dev/descriptors, see How to Configure Dynamic Forms.
2. Create a matching ConfigMap in kube-public
Use the same label key that your descriptor queries. For custom Tasks, prefer a label key that does not conflict with
default Task selectors to avoid accidental display in Hub Tasks.
Default Tasks ship
ConfigMapslabeledcatalog.tekton.dev/source: systemto indicate platform-provided entries. Do not modify or delete those, and your customConfigMapsshould not include this label.
You can also place the ConfigMap in any other namespace you prefer; you just need to make sure that the ConfigMap's namespace is the same as the namespace specified in the Task's style.tekton.dev/descriptors annotation.
For example, you can set the Task's annotation as in the example below, please replace <NAMESPACE> with your namespace.
3. Apply and validate
Open your Task form; the selector should list Python 3.13 (Team Edition) and set the image to
registry.example.com/internal/python:3.13.
Maintenance tips
- Update a custom option by editing and re-applying its
ConfigMap. - Retire an option by deleting only your custom
ConfigMap; leave anyConfigMapwithcatalog.tekton.dev/source: systemuntouched.