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

fix: shortid generates correctly now #62

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

maigl
Copy link
Contributor

@maigl maigl commented Jan 19, 2023

Sorry...

I committed some un-tested idea where I wanted to remove the ugly '-' and '_' in the shortid.
It doesn't work like that, and currently the runner name generation is broken!

Michael Kuhnt michael.kuhnt@mercedes-benz.com Mercedes-Benz Tech Innovation GmbH (ProviderInformation)

@@ -401,7 +398,7 @@ func (r *basePoolManager) AddRunner(ctx context.Context, poolID string) error {
if prefix == "" {
prefix = params.DefaultRunnerPrefix
}
name := fmt.Sprintf("%s-%s", prefix, shortid.MustNew(0, shortidABC, 42).String())
name := fmt.Sprintf("%s-%s", prefix, shortid.MustGenerate())
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the

newID, err := shortid.Generate()
if err != nil {
    return errors.Wrap(err, "generating ID")
}

We don't want to panic here.

@gabriel-samfira
Copy link
Member

No worries. Didn't catch the usage of Must either. I really need to find some time and add more test coverage!

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