-
Notifications
You must be signed in to change notification settings - Fork 42
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
Separate cmd from inspector impl #7
Conversation
nope, not hard. I can remove the scripts commit. |
@pweil- can you do that? I trust you ran the tests locally. Thanks. |
yep, will do it today. Output of test is in the description (you can see between PRs it jumps from 6% coverage to 75% coverage due to separation of the files). Also looking at the easiest way to test some of the other pieces. |
LGTM 👍 Thanks @pweil- ! This is great! |
I wasn't able to get to this today due to blocker bugs. Will have to get it tomorrow. Sorry about that. |
Actually I got to it... PTAL. Here is how I'm building/testing without the scripts in #6. If there is anything else you'd like me to test before submitting a PR please let me know. I probably won't be able to get back to the other unit tests until at least Monday.
|
if _, err := client.InspectImage(i.opts.Image); err != nil { | ||
log.Printf("Pulling image %s", i.opts.Image) | ||
imagePullOption := docker.PullImageOptions{Repository: i.opts.Image} | ||
imagePullAuths, authCfgErr := getAuthConfigs(i.opts.DockerCfg, i.opts.Username, i.opts.PasswordFile) |
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.
@pweil- can this be simplified with:
if imagePullAuths, err := getAuthConfigs(i.opts.DockerCfg, i.opts.Username, i.opts.PasswordFile); err != nil {
return err
}
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.
we could but we'd have to pre-declare the imagePullAuths
so I figured it's same/same either way (new error or new line for imagePullAuths
). Happy to update it though.
For the record I didn't reuse err
so we wouldn't shadow it in case it was ever used later in the life of this code.
@pweil- I had a couple of comments, the rest LGTM. |
@simon3z - fixed for your comments are in commit 2. If it looks good I'll squash. |
LGTM 👍 thanks @pweil- (I'll go over it once again to check everything) |
squashed |
fix typo in error message
Builds on #6removedSecond commit separates the command from the inspector implementation