-
Notifications
You must be signed in to change notification settings - Fork 84
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
Pull out the docker client #215
Conversation
I'm trying to split up my commits since each of these will be easier to review individually and they are each a feature. |
711825d
to
e1a092b
Compare
Testing: Run the normal broker tests. |
Make a seperate directory for clients so they are not apart of the APB code. This will make the clients easy to initialize and create new ones.
e1a092b
to
d2ce427
Compare
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.
The docker specific stuff here makes sense to me, but I have some thoughts on bringing more stuff out of apb/client.go into the clients package that's related to the k8s commit. Full PR review: #222
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.
Marking as request changes so it won't get merged until I review the last PR in the series. Again this would be easier as a single feature PR.
@@ -40,8 +39,6 @@ First cut might have to pass kubecfg from broker. FIRST SPRINT broker passes use | |||
admin/admin | |||
*/ | |||
|
|||
var DockerSocket = "unix:///var/run/docker.sock" |
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.
good
func NewClient(log *logging.Logger) (*Client, error) { | ||
dockerClient, err := docker.NewClient(DockerSocket) | ||
dockerClient, err := clients.Docker(log) |
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.
ok that's cleaner
) | ||
|
||
func Docker(log *logging.Logger) (*docker.Client, error) { | ||
dockerClient, err := docker.NewClient(DockerSocket) |
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.
This is nicer.
if err != nil { | ||
return nil, err | ||
} | ||
return config, nil |
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.
💡 Ok so this file is from the previous PR. Finally understood what's going on. I find the dependent PRs much harder to review. I would've preferred a clients feature to do all of the cleanup at once.
|
||
const ( | ||
DockerSocket = "unix:///var/run/docker.sock" | ||
) |
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.
Great! 👍
Approving this PR as well. Again removing |
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.
ACK, happy with this.
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.
Doc comments for all the exported stuff from the client package
logging "github.com/op/go-logging" | ||
) | ||
|
||
func Docker(log *logging.Logger) (*docker.Client, error) { |
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.
Before Merge, I think this needs doc comments.
Working in #222 |
Take out the docker client creation from the apbs package and put it along side the kubernetes client.
Partially-fixes: #213
Depends-on: #214