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

Pull out the docker client #215

Closed
wants to merge 2 commits into from

Conversation

rthallisey
Copy link
Contributor

@rthallisey rthallisey commented Jun 21, 2017

Take out the docker client creation from the apbs package and put it along side the kubernetes client.

Partially-fixes: #213
Depends-on: #214

@rthallisey
Copy link
Contributor Author

I'm trying to split up my commits since each of these will be easier to review individually and they are each a feature.

@rthallisey
Copy link
Contributor Author

Testing: Run the normal broker tests.

Ryan Hallisey added 2 commits June 23, 2017 08:14
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.
Copy link
Contributor

@eriknelson eriknelson left a 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

Copy link
Contributor

@jmrodri jmrodri left a 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"
Copy link
Contributor

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

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

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

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

Choose a reason for hiding this comment

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

Great! 👍

@jmrodri
Copy link
Contributor

jmrodri commented Jun 23, 2017

Approving this PR as well. Again removing Clients struct and reverting EtcdConfig to Config.

Copy link
Contributor

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

@shawn-hurley shawn-hurley self-requested a review June 23, 2017 20:36
Copy link
Contributor

@shawn-hurley shawn-hurley left a 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) {
Copy link
Contributor

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.

@rthallisey
Copy link
Contributor Author

Working in #222

@rthallisey rthallisey closed this Jun 23, 2017
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.

Break apart all the clients so they are easier to consume
4 participants