bridgecrewio / yor

Extensible auto-tagger for your IaC files. The ultimate way to link entities in the cloud back to the codified resource which created it.
https://www.yor.io
Apache License 2.0
808 stars 123 forks source link

GCP Labels cleanup logic does not work if tag prefix is specified #444

Closed abhay-precize closed 7 months ago

abhay-precize commented 10 months ago

Describe the bug Yor already handles fixing of certain label values based on the GCP constraints. Like '/' gets converted to '__' for git_file label value. But if yor argument tag-prefix is specified, this handling does not work.

Ref: This fix does not work when tag-prefix is specified - https://github.com/bridgecrewio/yor/pull/118

To Reproduce Steps to reproduce the behavior:

  1. Create any GCP terraform configuration
  2. Run cli command 'yor tag -d Templates/terraformgcp --tag-groups git **--tag-prefix myprefix** --tag-local-modules false'
  3. The generated labels are not supported according to GCP Labels constraints.

Expected behavior Even when we specify a tag-prefix, the GCP labels cleanup (replace of special characters) must be taken care of.

Screenshots

Without Prefix: Screenshot 2023-11-09 at 4 29 37 PM

With Prefix: Screenshot 2023-11-09 at 4 29 25 PM

Desktop (please complete the following information):

abhay-precize commented 10 months ago

@nimrodkor FYI, since you are the one who fixed it before :) Let me know if you need anything. Thanks in advance!

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.