-
Notifications
You must be signed in to change notification settings - Fork 881
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
sandbox_externalkey.go: split for cross compilation #770
Conversation
dd4b60b
to
2ac51e8
Compare
|
||
// SetExternalKey provides a convenient way to set an External key to a sandbox | ||
func SetExternalKey(controllerID string, containerID string, key string) 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update, wasn't aware of that kind of error, thanks
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -0,0 +1,177 @@ | |||
// +build linux freebsd |
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.
maybe !windows instead?
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.
alright
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
State
struct into platform specific structsin
opencontainers/runc@fe1cce6.
As a result,
NamespacePaths
isn't anymore in a global struct andlibnetwork is not cross-compiling in Docker (specifically on Windows) because
sandbox_externalkey.go
is usingNamespacePaths
.This patch splits
sandbox_externalkey.go
into 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