-
Notifications
You must be signed in to change notification settings - Fork 76
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
Import zdfs package to support a tricky OCIv1 tgz format #273
Conversation
af91eda
to
0d554ef
Compare
LGTM @WaberZhuang cc |
pkg/snapshot/overlay.go
Outdated
if ok { | ||
log.G(ctx).Infof("found imageRef: %s", img) | ||
if err := os.WriteFile(filepath.Join(td, "image_ref"), []byte(img), 0644); err != nil { | ||
log.G(ctx).Errorf("LSMD ERROR write imageRef '%s'. path: %s, err: %s", img, filepath.Join(td, "image_ref"), err.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.
nit: LSMD ERROR
in the log is confusing, as is err.Error()
if isOverlaybd, err := zdfs.PrepareOverlayBDSpec(ctx, key, id, o.snPath(id), oinfo, o.snPath); isOverlaybd { | ||
log.G(ctx).Infof("sn: %s is an overlaybd layer", id) | ||
} else if err != nil { | ||
log.G(ctx).Errorf("prepare overlaybd spec failed(sn: %s): %s", id, err.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.
use ("%v", err) to print error?
pkg/snapshot/overlay.go
Outdated
if ok { | ||
log.G(ctx).Infof("found imageRef: %s", img) | ||
if err := os.WriteFile(filepath.Join(path, "image_ref"), []byte(img), 0644); err != nil { | ||
log.G(ctx).Errorf("write imageRef '%s'. path: %s, err: %s", img, filepath.Join(path, "image_ref"), err.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.
use ("%v", err) to print error?
Signed-off-by: Yifan Yuan <[email protected]>
github.com/containerd/continuity v0.4.3 | ||
github.com/containerd/go-cni v1.1.9 | ||
github.com/containerd/log v0.1.0 | ||
github.com/data-accelerator/zdfs v0.1.3 |
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.
The package lacks license
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.
Sorry...
I have added Apache license to the project.
What this PR does / why we need it:
Add zdfs package import.
Packing the reference files of the overlaybd blob into the layer of the OCIv1 image; This enables the old version of containerd or other runtime (such as docker) to run overlaybd image
reference files like:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: