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

cli: allow tagging cloud resources with custom tags #3033

Merged
merged 28 commits into from
Apr 19, 2024
Merged

Conversation

miampf
Copy link
Contributor

@miampf miampf commented Apr 18, 2024

Context

Some users might want to use custom tags to group resources together.

Proposed change(s)

  • Add a flag -t/--tags to constellation config generate that writes additional tags into constellation-conf.yaml
    • Those tags will be passed to their respective cloud providers in constellation apply
    • In GCP, labels are used, in Azure and AWS tags

Additional Information

  • Since OpenStack does not support tagging their resources with key-value pairs, the key-value pairs in the constellation configuration are converted to strings in the form of key=value which are then applied as the tags.

Checklist

  • Update docs
  • Add labels (e.g., for changelog category)
  • Is PR title adequate for changelog?
  • Link to Milestone

@miampf miampf added the feature This introduces new functionality label Apr 18, 2024
Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for constellation-docs ready!

Name Link
🔨 Latest commit df5ba0a
🔍 Latest deploy log https://app.netlify.com/sites/constellation-docs/deploys/66222d237ea00f0008fda150
😎 Deploy Preview https://deploy-preview-3033--constellation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@miampf miampf added this to the v2.17.0 milestone Apr 18, 2024
@miampf miampf requested a review from malt3 April 18, 2024 15:15
@miampf miampf marked this pull request as ready for review April 18, 2024 15:24
@malt3
Copy link
Contributor

malt3 commented Apr 18, 2024

Tested this on OpenStack 👍

cli/internal/cmd/configgenerate.go Outdated Show resolved Hide resolved
cli/internal/cmd/configgenerate.go Outdated Show resolved Hide resolved
cli/internal/cmd/configgenerate.go Outdated Show resolved Hide resolved
internal/config/config.go Outdated Show resolved Hide resolved
@daniel-weisse
Copy link
Member

Tested successfully on GCP

Copy link
Contributor

Coverage report

Package Old New Trend
cli/internal/cloudcmd 19.00% 19.20% ↗️
cli/internal/cmd 41.10% 40.90% ↘️
cli/internal/terraform 56.80% 56.80% ↔️
internal/cloud/cloudprovider 92.60% 92.60% ↔️
internal/config 67.90% 68.00% ↗️

Copy link
Contributor

Coverage report

Package Old New Trend
cli/internal/cloudcmd 19.00% 19.20% ↗️
cli/internal/cmd 41.10% 40.90% ↘️
cli/internal/terraform 56.80% 56.80% ↔️
internal/cloud/cloudprovider 92.60% 92.60% ↔️
internal/config 67.90% 68.00% ↗️

Copy link
Member

@daniel-weisse daniel-weisse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from my side.
Did someone already test this on Azure and AWS?

@daniel-weisse daniel-weisse changed the title feat: Tag resources with custom tags cli: allow tagging cloud resources with custom tags Apr 19, 2024
@miampf
Copy link
Contributor Author

miampf commented Apr 19, 2024

I tested this on azure, AWS and GCP.

@miampf miampf merged commit b187966 into main Apr 19, 2024
11 checks passed
@miampf miampf deleted the custom-tag-resources branch April 19, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This introduces new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants