This enables including or excluding k8s_deploy targets based on build tag filters as well as other common tag based bazel operations like bazel query.
In particular, containers can be expensive to build. I can tag my container_images and then use build tag filters to ignore building those, but if they are used in a k8s_deploy, they cannot be excluded through a tag filter.
How Has This Been Tested?
I've tested this in my own project via
using a tag filter (e.g. --build_tag_filter=-excluded)
making sure if the container was built, it would fail (e.g. bad code)
having the "excluded" tag on both the container_image and k8s_deploy target
Also, I added usage of tags to the helloworld example for basic smoke test of functionality
Without this change, it would fail building (bazel build --build_tag_filter=-excluded //...), while with this change, it would pass with the same command.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
Add ability to use bazel tags on k8s_deploy targets so can use bazel tag filters on these targets to include or exclude from building.
Related Issue
https://github.com/adobe/rules_gitops/issues/144
Motivation and Context
This enables including or excluding k8s_deploy targets based on build tag filters as well as other common tag based bazel operations like bazel query.
In particular, containers can be expensive to build. I can tag my container_images and then use build tag filters to ignore building those, but if they are used in a k8s_deploy, they cannot be excluded through a tag filter.
How Has This Been Tested?
I've tested this in my own project via
--build_tag_filter=-excluded
)"excluded"
tag on both thecontainer_image
andk8s_deploy
targetAlso, I added usage of
tags
to the helloworld example for basic smoke test of functionalityWithout this change, it would fail building (
bazel build --build_tag_filter=-excluded //...
), while with this change, it would pass with the same command.Types of changes
Checklist: