Manage tags with decK

Uses: decK

Tags are at the core of federated configuration management, which allows each team to manage their own config.

Using the deck file tag commands, you can add tags to identify configuration lineage automatically without depending on your application teams understanding the process and remembering to apply tags consistently.

add-tags

The add-tags command can add tags to any entity. Here’s an example that adds the team-one tag to all entities in the provided file:

deck file add-tags -s ./config.yaml team-one

This is useful to track entity ownership when using the deck file merge command to build a single configuration to sync.

To add tags to specific entities only, provide the --selector flag. The provided tags will be added only to entities that match the selector

You can add multiple tags at once by providing them as additional arguments, for example: team-one another-tag and-another.

remove-tags

The opposite of add-tags, remove-tags allows you delete tags from your configuration file. It will remove the provided tag only by default:

deck file remove-tags -s ./config.yaml tag_to_remove

To keep specific tags and remove all others, pass the --keep-only flag:

deck file remove-tags -s ./config.yaml --keep-only env-prod team-one

Finally, to remove tags from specific entities you can pass a --selector. This can be combined with --keep-only as needed:

deck file remove-tags -s ./config.yaml \
  --selector "$..services[*]" \
  --keep-only env-prod team-one

list-tags

The list-tags command outputs all tags found in the file. Any tag that is applied to at least one entity is returned.

deck file list-tags -s ./config.yaml
Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!