-
Notifications
You must be signed in to change notification settings - Fork 241
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 packages to match latest code in moby/pkg #100
Conversation
@nalind PTAL |
140cc44
to
48832b6
Compare
@nalind Now passes tests. PTAL |
@@ -2,7 +2,6 @@ language: go | |||
go: | |||
- tip | |||
- 1.8 | |||
- 1.7 |
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 dropping 1.7 necessary here?
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.
No but why are we still doing it while everyone else has dropped it. runc/moby/cri-o ...
1.8 is supported on RHEL.
pkg/archive/changes.go
Outdated
@@ -181,7 +181,7 @@ func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Chan | |||
// If /foo/bar/file.txt is modified, then /foo/bar must be part of the changed files. | |||
// This block is here to ensure the change is recorded even if the | |||
// modify time, mode and size of the parent directory in the rw and ro layers are all equal. | |||
// Check https://github.com/docker/docker/pull/13590 for details. | |||
// Check https://github.com/containers/storage/pull/13590 for details. |
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.
Probably want to leave this one alone.
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
pkg/chrootarchive/diff_unix.go
Outdated
options.InUserNS = true | ||
} | ||
|
||
if tmpDir, err = ioutil.TempDir("/", "temp-docker-extract"); err != 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.
This reverts part of #17.
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
pkg/chrootarchive/diff_unix.go
Outdated
@@ -98,7 +108,7 @@ func applyLayerHandler(dest string, layer archive.Reader, options *archive.TarOp | |||
return 0, fmt.Errorf("ApplyLayer json encode: %v", err) | |||
} | |||
|
|||
cmd := reexec.Command("storage-applyLayer", dest) | |||
cmd := reexec.Command("docker-applyLayer", dest) |
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 has to agree with pkg/chrootarchive/archive_unix.go
.
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
#include <libdevmapper.h> | ||
#include <linux/fs.h> // FIXME: present only for BLKGETSIZE64, maybe we can remove it? | ||
|
||
// FIXME: Can't we find a way to do the logging in pure Go? | ||
extern void StorageDevmapperLogCallback(int level, char *file, int line, int dm_errno_or_class, char *str); | ||
extern void DevmapperLogCallback(int level, char *file, int line, int dm_errno_or_class, char *str); |
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 reverts #14.
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
pkg/plugins/discovery.go
Outdated
@@ -15,8 +15,7 @@ import ( | |||
var ( | |||
// ErrNotFound plugin not found | |||
ErrNotFound = errors.New("plugin not found") | |||
socketsPath = "/run/containers/storage/plugins" | |||
specsPaths = []string{"/etc/containers/storage/plugins", "/usr/lib/containers/storage/plugins"} | |||
socketsPath = "/run/docker/plugins" |
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 want to make this change?
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.
no
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
pkg/plugins/discovery_unix.go
Outdated
|
||
package plugins | ||
|
||
var specsPaths = []string{"/etc/docker/plugins", "/usr/lib/docker/plugins"} |
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.
Does this need to be changed?
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
pkg/plugins/discovery_windows.go
Outdated
"path/filepath" | ||
) | ||
|
||
var specsPaths = []string{filepath.Join(os.Getenv("programdata"), "docker", "plugins")} |
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.
Does this need to be changed?
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
It looks like some of the things we've changed in those files need to be reintegrated. |
99570a1
to
02a6e7f
Compare
@nalind I think I made all of the sed 's/docker-/storage-/g' changes back in. |
pkg/archive/archive_test.go
Outdated
if err == nil { | ||
t.Fatalf("UntarPath should throw an error if the destination if a file") | ||
} | ||
} | ||
|
||
// Do the same test as above but with the destination folder already exists | ||
// and the destination file is a directory | ||
// It's working, see https://github.com/docker/docker/issues/10040 | ||
// It's working, see https://github.com/containers/storage/issues/10040 |
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 one should be changed back.
pkg/archive/changes_test.go
Outdated
@@ -191,14 +180,14 @@ func TestChangesWithChanges(t *testing.T) { | |||
checkChanges(expectedChanges, changes, t) | |||
} | |||
|
|||
// See https://github.com/docker/docker/pull/13590 | |||
// See https://github.com/containers/storage/pull/13590 |
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 one should be changed 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.
Fixed
pkg/devicemapper/devmapper_log.go
Outdated
// in libdm (even debug ones because there's no way of setting the verbosity | ||
// level for an external logging callback). | ||
//export DevmapperLogCallback | ||
func DevmapperLogCallback(level C.int, file *C.char, line, dmErrnoOrClass C.int, message *C.char) { |
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.
We need to leave this rename in place, to avoid symbol multiply-defined errors when this version of the library is pulled in by a newer containers/image into dockerd, per #14.
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.
Ok changed 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.
No, it needs to be left renamed to StorageDevmapperLogCallback
, as it was before this PR.
pkg/plugins/discovery_unix_test.go
Outdated
} | ||
|
||
path := filepath.Join(tmpdir, "echo.spec") | ||
addr := "unix://var/lib/docker/plugins/echo.sock" |
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.
Non-blocking: might want to move this. The spec file that points to the listening socket is still written in the location where the discovery logic looks, so this test passes, but it's a little confusing.
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.
Changed to containers/storage
Mostly minor things around renaming, otherwise LGTM. |
Will merge once tests pass. |
Had to vendor in a new version of golang.org/x/net to build Also had to make some changes to drivers to handle archive.Reader -> io.Reader archive.Archive -> io.ReadCloser Also update .gitingore to ignore emacs files, containers-storage.* and generated man pages. Also no longer test travis against golang 1.7, cri-o, moby have also done this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Tests pass, so merging. |
Had to vendor in a new version of golang.org/x/net to build
Also had to make some changes to drivers to handle
archive.Reader -> io.Reader
archive.Archive -> io.ReadCloser
Also update .gitingore to ignore emacs files, containers-storage.*
and generated man pages.
Signed-off-by: Daniel J Walsh dwalsh@redhat.com