Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Fixes #14181 - Validate registry URL and attempt login #142

Closed
wants to merge 1 commit into from

Conversation

dLobatog
Copy link
Member

In order to avoid users trying to create containers in an external
registry that doesn't exist, we should provide some preventative
measures.

url,
credentials)
::Docker.authenticate!(credentials, connection)
rescue => e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about catching Docker::Error::AuthenticationError here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can but does it deserve special treatment? I left it to catch all StandardError as to catch network problems etc...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess my concern is that this could swallow exceptions that we haven't anticipated if we're catching StandardError--exceptions that have nothing to do with the actual connection.

Edit: This is fine for now though. We can change it up later if we need to.

@daviddavis
Copy link

Could you add a test for attempt_login?

@daviddavis
Copy link

Tested and it worked. 👍

Add a test for attempt_login and I'll ACK. Thanks!

In order to avoid users trying to create containers in an external
registry that doesn't exist, we should provide some preventative
measures.
@dLobatog
Copy link
Member Author

@daviddavis Updated with an unit test!

@daviddavis
Copy link

Shoot, I actually merged your commit (9ea4059) but it looks like master is failing. Am rerunning master and this PR and will investigate any breakages. Sorry!

@daviddavis
Copy link

Green :)

@daviddavis daviddavis closed this Mar 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants