-
Notifications
You must be signed in to change notification settings - Fork 511
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
add timeout on docker username #1200
Conversation
Can one of the admins verify this patch? |
closes #1184 |
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.
works locally, just would be great to get a more verbose log since the 401 error isn't very helpful:
🐳 $ bin/notary -s https://notary.docker.io list docker.io/some/repo
Enter username:
* fatal: you are not authorized to perform this operation: server returned 401.
cmd/notary/tuf.go
Outdated
return "","" | ||
} | ||
case <-time.After(30 * time.Second): | ||
return "","" |
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.
can we add an error log here? Something like timeout when retrieving username input
?
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 nit, thanks @eiais!
cmd/notary/tuf.go
Outdated
return "","" | ||
} | ||
case <-time.After(30 * time.Second): | ||
logrus.Errorf("timeout when retrieving username input") |
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.
nit: this can just be logrus.Error
(no need for formatting)
Signed-off-by: Kyle Spiers <kyle@spiers.me> add additional error logging Signed-off-by: Kyle Spiers <kyle@spiers.me>
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.
Leaves a dangling goroutine which isn't great but in context of short CLI commands it's not a reason to hold this up (given there doesn't appear to be a particularly good fix).
LGTM.
This should fix scripts that never end due to a user/pass prompt.
Signed-off-by: Kyle Spiers kyle@spiers.me