Skip to content
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

Merged
merged 1 commit into from
Aug 1, 2017
Merged

add timeout on docker username #1200

merged 1 commit into from
Aug 1, 2017

Conversation

eiais
Copy link
Contributor

@eiais eiais commented Jul 24, 2017

This should fix scripts that never end due to a user/pass prompt.
Signed-off-by: Kyle Spiers kyle@spiers.me

@docker-jenkins
Copy link

Can one of the admins verify this patch?

@eiais
Copy link
Contributor Author

eiais commented Jul 24, 2017

closes #1184

Copy link
Contributor

@riyazdf riyazdf left a 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.

return "",""
}
case <-time.After(30 * time.Second):
return "",""
Copy link
Contributor

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?

Copy link
Contributor

@riyazdf riyazdf left a 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!

return "",""
}
case <-time.After(30 * time.Second):
logrus.Errorf("timeout when retrieving username input")
Copy link
Contributor

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>
Copy link
Contributor

@endophage endophage left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants