Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of bazel tags to rules_gitops #148

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Conversation

bhmiller
Copy link
Contributor

@bhmiller bhmiller commented Sep 7, 2023

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

#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

  • 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)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

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.
@bhmiller bhmiller requested a review from a team as a code owner September 7, 2023 01:05
kzadorozhny
kzadorozhny previously approved these changes Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants