-
Notifications
You must be signed in to change notification settings - Fork 874
fix!: enforce regex for agent names #16641
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
Conversation
Underscores and double hyphens are now blocked. The regex is almost the exact same as the `coder_app` `slug` regex, but uppercase characters are still permitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after a lint!
I like that we have a clear error message on what changed.
if tfResource.Name == "" { | ||
return nil, xerrors.Errorf("agent name cannot be empty") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically already checked for us by Terraform, but I think it's fine to check again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess in case we ever change how we extract the name it's good to have
@ethanndickson @stirby, we need to call this out in the changelog. |
Yep, this and #16614 are both annotated with the breaking tag |
Underscores and trailing, leading and double hyphens are now blocked. The regex is almost the exact same as the
coder_app
slug
regex, but uppercase characters are still permitted.