sandbox_externalkey.go: split for cross compilation#770
Conversation
dd4b60b to
2ac51e8
Compare
sandbox_externalkey_unsupported.go
Outdated
There was a problem hiding this comment.
Shouldn't all these return an appropriate error? We specifically have an error interface defined for this purpose.
https://github.com/docker/libnetwork/blob/master/types/types.go#L480
There was a problem hiding this comment.
I'll update, wasn't aware of that kind of error, thanks
There was a problem hiding this comment.
@mrjana there's a problem with https://github.com/docker/libnetwork/blob/master/controller.go#L200 because if we now return an error something can break if some Docker code path come across this and controller.go seems pretty platform agnostic, WDYT?
There was a problem hiding this comment.
I've made what's used outside those files to return nil as a no-op and return a ErrNotImplemented otherwise, I hope it makes sense now
There was a problem hiding this comment.
I also think only SetExternalKey should return that kind of error because it's part of the API, the other functions can basically return nil
03f1c3c to
41eff70
Compare
|
LGTM |
|
@runcom this fix seems to have made the |
dfda5e0 to
3b00cdf
Compare
sandbox_externalkey_unix.go
Outdated
3b00cdf to
6df87a4
Compare
|
@jfrazelle updated as per your comment |
6df87a4 to
1985db8
Compare
|
\o/ all up to @mavenugo |
|
Sorry about the delay. |
|
make sense, most docker code is the way you said @mavenugo (i.e. https://github.com/docker/docker/blob/master/daemon/container_windows.go and https://github.com/docker/docker/blob/master/daemon/container_unix.go) |
runc/libcontainer split the `State` struct into platform specific structs in opencontainers/runc@fe1cce6. As a result, `NamespacePaths` isn't anymore in a global struct and libnetwork is not cross-compiling in Docker (specifically on Windows) because `sandbox_externalkey.go` is using `NamespacePaths`. This patch splits `sandbox_externalkey.go` into platform specific files and moves common things to a generic `sandbox_externalkey.go`. Signed-off-by: Antonio Murdaca <runcom@redhat.com>
1985db8 to
806157b
Compare
|
green again :) I'm testing with Docker&libcontainer in make cross |
|
Thanks. LGTM |
|
LGTM |
sandbox_externalkey.go: split for cross compilation
|
Thanks all! |
runc/libcontainer split the
Statestruct into platform specific structsin
opencontainers/runc@fe1cce6.
As a result,
NamespacePathsisn't anymore in a global struct andlibnetwork is not cross-compiling in Docker (specifically on Windows) because
sandbox_externalkey.gois usingNamespacePaths.This patch splits
sandbox_externalkey.gointo platform specificfiles and moves common things to a generic
sandbox_externalkey.go.related to moby/moby#18106
Signed-off-by: Antonio Murdaca runcom@redhat.com