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

Trim trailing '-' sign #955

Merged
merged 5 commits into from
Apr 20, 2021
Merged

Trim trailing '-' sign #955

merged 5 commits into from
Apr 20, 2021

Conversation

bathina2
Copy link
Contributor

Change Overview

This changes the sanitization function to trim any trailing '-' signs. These cause malformed labels.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • πŸ› Bugfix
  • 🌻 Feature
  • πŸ—ΊοΈ Documentation
  • πŸ€– Test

Issues

  • K10-5868

Test Plan

  • πŸ’ͺ Manual
  • ⚑ Unit test
  • πŸ’š E2E

Here's what I recommend.
@@ -88,6 +88,7 @@ func SanitizeValueForGCP(value string) string {
}
sanitizedVal = strings.ToLower(sanitizedVal)
sanitizedVal = re.ReplaceAllString(sanitizedVal, "_")
sanitizedVal = strings.TrimRight(sanitizedVal, "_-")
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend trimming right for "_-" after the replacement.

@bathina2 bathina2 added the kueue label Apr 20, 2021
@mergify mergify bot merged commit 5a2294c into master Apr 20, 2021
@mergify mergify bot deleted the K10-5868 branch April 20, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants