- Notifications
You must be signed in to change notification settings - Fork1k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Underscores and double hyphens are now blocked. The regex is almost theexact same as the `coder_app` `slug` regex, but uppercase characters arestill permitted.
ethanndickson left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
iftfResource.Name=="" { | ||
returnnil,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?
ethanndicksonFeb 20, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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
9469b78
intomainUh oh!
There was an error while loading.Please reload this page.
@ethanndickson@stirby, we need to call this out in the changelog. |
Yep, this and#16614 are both annotated with the breaking tag |
Uh oh!
There was an error while loading.Please reload this page.
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.