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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker client library for odo #2724

Merged
merged 9 commits into from Mar 25, 2020

Conversation

@johnmcollier
Copy link
Collaborator

johnmcollier commented Mar 16, 2020

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind feature

What does does this PR do / why we need it:
This PR creates a client library interface (called lclient currently, open to better names 馃槈 ) for odo to interact with Docker. This PR pulls in the official github.com/docker/docker library and dependencies and uses it to interact with containers

  • Vendors github.com/docker/docker and its dependencies (first time doing this, let me know if I messed this part up). First two commits cover this.
    • Vendored via glide get github.com/docker/docker --strip-vendor
  • Implements a basic lclient package in odo to interact with Docker
    • Functions to create container, retrieve container with a given label, and pull images. Will expand as needed
  • Unit tests for the functions I added, as well as a stub mock Docker client
  • No integration tests at the moment, as nothing is actually using this code currently

Which issue(s) this PR fixes:

Fixes #2578

Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@johnmcollier johnmcollier changed the title Docker client lib Add Docker client library for odo Mar 16, 2020
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@@ -0,0 +1,195 @@
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.

This comment has been minimized.

Copy link
@cdrage

cdrage Mar 16, 2020

Collaborator

Please confirm with legal that we can have this copyright here. I don't think it'd be compatible with our current license.

This comment has been minimized.

Copy link
@johnmcollier

johnmcollier Mar 16, 2020

Author Collaborator

That was added erroneously and should not be there, removed.

Signed-off-by: John Collier <John.J.Collier@ibm.com>
@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 16, 2020

Codecov Report

Merging #2724 into master will increase coverage by 0.43%.
The diff coverage is 48.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2724      +/-   ##
==========================================
+ Coverage   43.49%   43.92%   +0.43%     
==========================================
  Files          86       91       +5     
  Lines        7907     8141     +234     
==========================================
+ Hits         3439     3576     +137     
- Misses       4131     4218      +87     
- Partials      337      347      +10
Impacted Files Coverage 螖
pkg/lclient/client.go 0% <0%> (酶)
pkg/lclient/fakeclient.go 42.62% <42.62%> (酶)
pkg/lclient/images.go 60% <60%> (酶)
pkg/lclient/containers.go 88.88% <88.88%> (酶)
pkg/project/project.go 55.12% <0%> (-0.28%) 猬囷笍
pkg/odo/cli/service/create.go 20% <0%> (酶) 猬嗭笍
pkg/devfile/parser/apiVersion.go 76.47% <0%> (酶) 猬嗭笍
pkg/kclient/services.go 100% <0%> (酶)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update b9bdb6b...a8d8f0f. Read the comment docs.

Copy link
Collaborator

rajivnathan left a comment

Reviewed the lclient package only, will let someone more familiar with the glide dependencies to verify that.

pkg/lclient/images.go Outdated Show resolved Hide resolved
pkg/lclient/images.go Outdated Show resolved Hide resolved
pkg/lclient/images.go Outdated Show resolved Hide resolved
pkg/lclient/images.go Outdated Show resolved Hide resolved
pkg/lclient/client.go Outdated Show resolved Hide resolved
pkg/lclient/containers.go Outdated Show resolved Hide resolved
pkg/lclient/containers_test.go Outdated Show resolved Hide resolved
Signed-off-by: John Collier <John.J.Collier@ibm.com>
"github.com/pkg/errors"
)

const errorMsg = `

This comment has been minimized.

Copy link
@adisky

adisky Mar 23, 2020

Collaborator

const?

This comment has been minimized.

Copy link
Collaborator

rajivnathan left a comment

lclient changes look good, can someone from the odo team take a look at the dependency changes to verify they're okay?

@kadel

This comment has been minimized.

Copy link
Member

kadel commented Mar 24, 2020

/approve

@openshift-ci-robot

This comment has been minimized.

Copy link

openshift-ci-robot commented Mar 24, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cdrage
cdrage approved these changes Mar 24, 2020
Copy link
Collaborator

cdrage left a comment

Phew that's a lot of code.

Everything LGTM. I understand that this code is needed to get some other work completed / done. So I'll be forgoing an intense review.

LGTM!

/lgtm

@johnmcollier

This comment has been minimized.

Copy link
Collaborator Author

johnmcollier commented Mar 24, 2020

/retest

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Copy link

openshift-bot commented Mar 25, 2020

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 0add600 into openshift:master Mar 25, 2020
6 checks passed
6 checks passed
Travis CI - Pull Request Build Passed
Details
ci/prow/unit Job succeeded.
Details
ci/prow/v4.1-integration-e2e-benchmark Job succeeded.
Details
ci/prow/v4.2-integration-e2e-benchmark Job succeeded.
Details
ci/prow/v4.3-integration-e2e-benchmark Job succeeded.
Details
tide In merge pool.
Details
@jcockbain jcockbain mentioned this pull request Mar 26, 2020
1 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

8 participants
You can鈥檛 perform that action at this time.