Skip to content

CR-13046 cluster name bug #485

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

Merged
merged 4 commits into from
Jul 14, 2022
Merged

CR-13046 cluster name bug #485

merged 4 commits into from
Jul 14, 2022

Conversation

rotem-codefresh
Copy link
Contributor

No description provided.

beginsWithNum := regexp.MustCompile(`^\d`)

if beginsWithNum.MatchString(name) {
name = fmt.Sprint("a", name)
Copy link
Contributor

Choose a reason for hiding this comment

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

what does that do? just add "a" at the beginning?
what if now the name is too long? why "a" and not anything else? why not just remove all digits in the prefix?
also - why not "a"+name?

Comment on lines 240 to 242
if beginsWithNum.MatchString(name) {
name = beginsWithNum.ReplaceAllString(name, "")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if you just run

name = beginsWithNum.ReplaceAllString(name, "")

wouldn't it just not do anything if there are no digits at the start?

@rotem-codefresh rotem-codefresh merged commit 9543b19 into main Jul 14, 2022
@rotem-codefresh rotem-codefresh deleted the CR-13046-cluster-name branch July 14, 2022 14:55
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