Repository navigation
Add generic tags ops file - #534
Merged
Merged
Conversation
Adds misc/tags.yml, a reusable ops file that applies a map of tags to every instance in a deployment through the top-level tags key. The BOSH director forwards deployment tags to the CPI as instance metadata. On GCP the google CPI surfaces them as resource labels (visible in cost/billing reports); other CPIs map them onto their own resource metadata (for example AWS EC2 tags). The file takes a single tags map variable so it is not tied to a particular key schema and can be shared by any deployment. Usage: bosh deploy ... -o misc/tags.yml --vars-file tags.yml
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rkoster
approved these changes
Sep 24, 2026
`tags` is already used by the CPI ops files (gcp/cpi.yml, gcp/cloud-config.yml) for VM network tags, which are a list. Reusing the same name for the deployment tag map collides: when a single `tags` value is supplied, both interpolations cannot be satisfied (list vs map). Rename the variable to `deployment_tags` and correct the usage docs: a JSON map can be passed with `-v`, not only with `--vars-file`. Also note the variable choice in the README entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
misc/tags.yml, a reusable ops file that applies a map of deployment tags to every instance in a deployment via the top-level BOSHtagskey.The BOSH director forwards deployment tags to the CPI as instance metadata. On GCP the google CPI surfaces them as resource labels (visible in cost/billing reports); other CPIs map them onto their own resource metadata (for example AWS EC2 tags). The file takes a single
deployment_tagsmap variable, so it is not tied to a particular key schema and can be shared by any deployment/pipeline.Why
deployment_tagsand nottagsbosh-deployment's CPI ops files already use atagsvariable for VM network tags, which are a list (gcp/cpi.yml,gcp/cloud-config.yml, andjumpbox-deployment). Reusingtagsfor the deployment tag map collides: with onetagsvalue supplied, both interpolations cannot be satisfied (list vs map).deployment_tagskeeps the two independent.Usage
bosh deploy ... -o bosh-deployment/misc/tags.yml \ -v 'deployment_tags={"pipeline":"bosh-deployment","environment":"my-env"}'or with a vars file:
Any
tagsdefined directly in the deployment manifest are replaced by this ops file.Verification
Local
bosh7.10.11:bosh interpolate misc/tags.yml→ exit 0 (passes thefind . -name '*.yml' | xargs bosh interpolatesyntax check intests/run-checks.sh)tags+ this ops file →tags:created with the supplied maptags+ this ops file → replaced by the supplied map-v 'deployment_tags={...}'(JSON map) and--vars-fileinterpolate correctly-v 'tags=["..."]'network-tags value (the previous collision) without conflictNotes
cloudfoundry/bosh-bootloader#694, which letsbbllabel the director/jumpbox VMs and its terraform resources. This ops file is for the resources created by deployments (for example CF, Concourse) run against a director.