-
Notifications
You must be signed in to change notification settings - Fork 36
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 koyeb instance exec xxx
when instance id is a full uuid
#167
Comments
Can I take this up? koyeb-cli/pkg/koyeb/idmapper/idmap.go Lines 19 to 22 in 7f71b41
The issue is because we are looking for the full uuid in the Can I do something like func (idmap *IDMap) GetID(val string) (string, bool) {
id, ok := idmap.valCache[val]
// If there is a match for the long id, I simply return the long id
if _, ok := idmap.idCache[val]; ok {
return val, ok
}
return id, ok
} I thought this doesn't change any other functions and has the least impact? Cheers. |
Hey, That's not what we should do. We already check specifically for UUIDv4 at this spot in our code: instance.go#L28. A few months ago, we changed our UUIDs from v4 to a fully random format. The difference? UUIDv4 has some bits set aside, but our new ones don't. Instead of checking for UUIDv4, we should check for any UUID. |
Got it. So, I need to check for a generic UUID instead of the more stricter rule that checks for koyeb-cli/pkg/koyeb/idmapper/regex.go Lines 5 to 8 in 7f71b41
Replacing this with the more flexible version of UUID regex const (
// UUIDv4 is the regular expressions for an UUID v4.
- UUIDv4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
+ UUIDv4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
) Works? |
I don't know why we are doing a regexp matching here. I believe we should use the uuid module instead:
We can change the existing function |
I was trying to not change a lot of code around and work with what's already there. |
thank you! Feel free to make a pull request |
If we provide a full uuid, the following error message is returned:
It works well if the short uuid is used (56baae83)
The text was updated successfully, but these errors were encountered: