-
Notifications
You must be signed in to change notification settings - Fork 174
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
Update Docker Personality to support Docker API 1.25 [full ci] #3756
Conversation
72e0271
to
f8478b7
Compare
@@ -24,8 +24,8 @@ import ( | |||
|
|||
log "github.com/Sirupsen/logrus" | |||
|
|||
"github.com/docker/distribution/digest" | |||
derr "github.com/docker/docker/errors" | |||
// "github.com/docker/distribution/digest" |
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.
remove it?
@@ -84,7 +85,7 @@ type VicContainerProxy interface { | |||
CommitContainerHandle(handle, containerID string, waitTime int32) error | |||
StreamContainerLogs(name string, out io.Writer, started chan struct{}, showTimestamps bool, followLogs bool, since int64, tailLines int64) error | |||
|
|||
Stop(vc *viccontainer.VicContainer, name string, seconds int, unbound bool) error | |||
Stop(vc *viccontainer.VicContainer, name string, seconds *int, unbound bool) 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.
why pointer?
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 Docker's change.
@@ -711,11 +712,20 @@ func (c *ContainerProxy) AttachStreams(ctx context.Context, vc *viccontainer.Vic | |||
plClient, transport := c.createNewAttachClientWithTimeouts(attachConnectTimeout, 0, attachAttemptTimeout) | |||
defer transport.Close() | |||
|
|||
keys := []byte{} |
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.
in this case it cases memory allocation. Try to use "var keys []byte"
@@ -129,3 +129,9 @@ func (e *endpoint) Address() *net.IPNet { | |||
func (e *endpoint) AddressIPv6() *net.IPNet { | |||
return nil | |||
} | |||
|
|||
// DisableService removes a managed contianer's endpoints from the load balancer |
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 comment is definitely invalid. Could you fix it?
import ( | ||
"io" | ||
"time" | ||
|
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.
remove empty line here.
d981394
to
fd90e5a
Compare
Let me know when you need review. |
@vburenin Sure thing. I still need to get networking fully working and write robot scripts to verify we don't croak on swarm, checkpoint, build, and plugin calls. |
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.
I approve this vendor rev
df24972
to
8a4a503
Compare
3521f72
to
b74444d
Compare
@@ -0,0 +1,40 @@ | |||
// Copyright 2016 VMware, Inc. All Rights Reserved. |
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.
it is 2017 outside, at least it was so yesterday ;)
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 catch :)
b74444d
to
70f254f
Compare
} | ||
|
||
func (b SwarmBackend) CreateManagedNetwork(clustertypes.NetworkCreateRequest) error { | ||
return 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.
Am I correct in assuming that we have to make this a noop instead an "unsupported" error?
Same question for the other operations.
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.
Docker called it a "backend," but it's not a REST router backend. The actual REST router backend is in lib/apiservers/engine/backends/swarm.go.
@@ -183,10 +182,10 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) { | |||
return copyImageConfig(config), nil | |||
} | |||
|
|||
func (ic *ICache) getImageByDigest(digest digest.Digest) *metadata.ImageConfig { | |||
func (ic *ICache) getImageByDigest(digest string) *metadata.ImageConfig { |
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.
is this change to signature needed - from just this commit it looks like the original code cast it to string where needed and it's got to be a string type anyway given the comparison on line 167
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.
I cannot remember why I did this. I remember it was to get around a build issue, but that was before 1.13 officially got released. With the updated vendored files, the old signature works so I reverted it back.
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.
Didn't notice any issues from a scan - would like someone else to look through it as well. I've not confirmed function.
70f254f
to
571af5e
Compare
Does this fix #3712 too? |
nvm ... I guess you left the networking part out. |
@hmahmood Yeah, I left it out. Before fully hooking up the cluster management code, I wanted to see if minimally hooking it up would pass our integration tests so we can avoid unnecessary work. |
package backends | ||
|
||
import ( | ||
"fmt" |
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.
minor: indent is short
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.
fixed
@@ -20,6 +20,7 @@ import ( | |||
"github.com/docker/docker/pkg/stringid" | |||
"github.com/docker/libnetwork" | |||
"github.com/docker/libnetwork/types" | |||
// "k8s.io/minikube/pkg/minikube/notify" |
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.
Not sure if you left this on purpose, just bringing it to your attention :)
Should Be Equal As Integers ${rc} 1 | ||
Should Contain ${output} does not yet support plugins | ||
|
||
#Docker plugin create |
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.
Do we still need/want this test? Could we maybe pass & warn or something?
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.
Fixed that test.
cmd/docker/main.go
Outdated
@@ -1,4 +1,4 @@ | |||
// Copyright 2016-2017 VMware, Inc. All Rights Reserved. | |||
// Copyright 2016 VMware, Inc. All Rights Reserved. |
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.
Looks like you accidentally removed the copyright
@@ -166,6 +166,7 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) { | |||
var config *metadata.ImageConfig | |||
if imgDigest != "" { | |||
config = ic.getImageByDigest(imgDigest) | |||
// config = ic.getImageByDigest(string(imgDigest)) |
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.
Commented code
"github.com/docker/engine-api/types/registry" | ||
"github.com/docker/docker/api/types" | ||
"github.com/docker/docker/api/types/backend" | ||
// "github.com/docker/docker/api/types/container" |
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.
commented import
@@ -184,6 +185,7 @@ func (ic *ICache) Get(idOrRef string) (*metadata.ImageConfig, error) { | |||
} | |||
|
|||
func (ic *ICache) getImageByDigest(digest digest.Digest) *metadata.ImageConfig { | |||
// func (ic *ICache) getImageByDigest(digest string) *metadata.ImageConfig { |
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.
commented code
428ddc2
to
4f6dbfd
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.
LGTM
The following are vendored source changes. The term rolled up means the nested vendored version of a repo within VIC's top level vendored sources were removed in favor of VIC's to avoid golang's namespace collision. For example, vic/vendor/github.com/docker/distribution vic/vendor/github.com/docker/docker/vendor/github.com/docker/distribution In the above example, the second repo was removed. 1. Updated github.com/docker/docker to 1.13. 2. Updated github.com/docker/distribution to 28602af35aceda2f8d571bad7ca37a54cf0250bc -- rolled up ditribution in docker/docker 3. Updated github.com/docker/libtrust to 9cbd2a1374f46905c68a4eb3694a130610adc62a -- rolled up libtrust in docker/docker -- rolled up libtrust in docker/distribution 4. Updated github.com/docker/swarmkit to 335561b66a44bf214224afe879e4368204e7fa45 -- rolled up swarmkit in docker/docker 5. Updated github.com/Sirupsen/logrus to v0.11.0 -- rolled up logrus in docker/docker -- rolled up logrus in docker/swarmkit 6. Updated google.golang.org/grpc to v1.0.2 -- rolled up in docker/docker -- rolled up in docker/swarmkit 7. github.com/golang/protobuf to 1f49d83d9aa00e6ce4fc8258c71cc7786aec968a 8. github.com/vishvananda/netns to 604eaf189ee867d8c147fafc28def2394e878d25 -- rolled up in docker/docker 9. github.com/vishvananda/netlink to 482f7a52b758233521878cb6c5904b6bd63f3457 -- rolled up in docker/docker 10. Rolled up go-connections in docker/docker 11. Rolled up github.com/golang/x/net/context in docker/docker and docker/swarmkit
1. Updated all the backend interfaces within vic/lib/apiservers/backends 2. Added hollowed out swarm.go and backends/exec/SwarmBackend.go 3. Updated main.go 4. Added robot scripts for docker secret, checkpoint, deploy, node, plugin, service, stack, swarm.
4f6dbfd
to
64f6dcc
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.
lgtm
vic/lib/apiservers/backends
plugin, service, stack, swarm.
resolves #3415