fix!: enforce agent names be case-insensitive-unique per-workspace - #16614
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ea0c978 to
5241805
Compare
5241805 to
566e3de
Compare
mafredri
left a comment
There was a problem hiding this comment.
I had no idea this was allowed 🤯, nice find!
Should we add this guard on the provider as well? I'm thinking we can surface the error faster/better over there. I absolutely think it's worth guarding the input here as well, though.
Unfortunately not possible, since we derive the agent name from the name of the resource, which the provider SDK purposefully doesn't expose to us :( [1] i.e. for For the same reason, you can't use the |

Relates to coder/coder-desktop-macos#54
Currently, it's possible to have two agents within the same workspace whose names only differ in capitalization:
This leads to an ambiguity in two cases:
agent.workspace.username.coder.coder_apps) currently use subdomains of the form:<app>--<agent>--<workspace>--<username>(--<suffix>)?.Of note is that DNS hosts must be strictly lower case, hence the ambiguity.
This fix is technically a breaking change, but only for the incredibly rare use case where a user has:
Those templates & workspaces will now fail to build. This can be fixed by choosing wholly unique names for the agents.