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
.
Usage:
deck file add-tags [flags] tag [...tag]
Examples:
# adds tags 'tag1' and 'tag2' to all services in file 'kong.yml'
cat kong.yml | deck file add-tags --selector='services[*]' tag1 tag2
Flags:
--format string Output format: json or yaml (default "yaml")
-h, --help help for add-tags
-o, --output-file string Output file to write to. Use - to write to stdout. (default "-")
--selector stringArray JSON path expression to select objects to add tags to.
Defaults to all Kong entities. Repeat for multiple selectors.
-s, --state string decK file to process. Use - to read from stdin. (default "-")