---
# System prepended metadata

title: Untitled

---

Problem we are trying to solve here is the maintenance of categories, tags, their relations etc.

Tag is an array of string, where you can add any no. of strings and any value, this is completely upto the author. Eg: `tekton.dev/tags: s2i, go, workspace`

Till now, we have list of categories in HUB, that we show on left panel to filter the resources. But the management of this is all manual and we do during release time, like map the tags which are not there in any categories to a particular category.

Ref: https://github.com/tektoncd/hub/blob/master/config.yaml#L15

The problem with this approach is same tag can be used in multiple categories like golang-build can have `build` tag and docker-build can have `build` tag and this ends up in different task showing up in random categories like if we match `build` to image build category. Also sometimes we end up in tags with very minimum differences like `image, images` etc

So the end goal is to make the manual work automated and also properly do the mapping of the resources. And this should be in proper state at any point of time, not only for release.

Then we came up with this proposal like having the categories field explicitly on the resource and tags can be anything which can help users to identify, search etc. Categories will be only one for a single resource and tags can be any number of items. Value of categories will be something from a pre-defined set and tags can be any values which authors thinks to have.

Stating an example of how a `docker build` task can look like

```
    tekton.dev/category: "Image-Build"
    tekton.dev/tags: docker, build, cli, image, image-build, images
```

We can also add a check in catlin to have categories as a requirement and also verify the value of it to be one from the pre-defined list.

**How Categories and Tags make a difference**

- Since any resource can have only one category, so category can be used for filtering as in it will be showing resources from that single category.
- Tags are any values provided by author and same tag can be there in multiple resource of different categroies. It can be used for searching based on the example below.

Eg: Searching with tag like `cli` can show resources from `Cloud` category like `aws-cli`, `Image-Build` category like `docker`, `buildah` etc, `Lint` category like `golanci-lint`, `pylint` etc

**Example of Operator Hub**

Yes Operator Hub provides both categories and tags for CSV. The word they use is `keywords` for `tags`.

1. Predefined list of categories for Operator Hub - https://github.com/operator-framework/api/blob/master/pkg/validation/internal/operatorhub.go#L37

2. Choosing a single category in CSV - https://github.com/operator-framework/community-operators/blob/834f2e89f3f73612cc59496c113ce21d739d991f/community-operators/etcd/0.9.4/etcdoperator.v0.9.4.clusterserviceversion.yaml#L19

3. Specifying keywords(tags) in CSV - https://github.com/operator-framework/community-operators/blob/834f2e89f3f73612cc59496c113ce21d739d991f/community-operators/etcd/0.9.4/etcdoperator.v0.9.4.clusterserviceversion.yaml#L282
