This repository was archived by the owner on Jan 15, 2026. It is now read-only.
doc.go: Perfect description#177
Merged
stevvooe merged 1 commit intoopencontainers:masterfrom Jan 2, 2018
Merged
Conversation
wking
reviewed
Aug 30, 2017
image/doc.go
Outdated
| // limitations under the License. | ||
|
|
||
| // Package image defines methods for validating, and unpacking OCI images. | ||
| // Package image defines methods for validating, unpacking and creating OCI images. |
Contributor
There was a problem hiding this comment.
What functionality does it provide for creating images? The only creation functionality I can find is for bundle creation (e.g. CreateRuntimeBundle), and that's part of unpacking an image.
I'd expect image creation to include layer generation (in flight with #8), CAS pushing (in flight with #5), and/or index generation (something like it in #5, but I'm not aware of any image-tools work on this front since opencontainers/image-spec#533).
Author
There was a problem hiding this comment.
What functionality does it provide for creating images?
createBundle
Author
There was a problem hiding this comment.
I think the new changes can express my thoughts.
coolljt0725
pushed a commit
that referenced
this pull request
Oct 19, 2017
Implementing the logic that is in-flight with [1], but using recursive removal [2]. GNU tar has a --recursive-unlink option that's not enabled by default, with the motivation being something like "folks would be mad if we blew away a full tree and replaced it with a broken symlink" [3]. That makes sense for working filesystems, but we're building the rootfs from scratch here so losing information is not a concern. This commit always uses recursive removal to get that old thing off the filesystem (whatever it takes ;). The exception to the removal is if both the tar entry and existing path occupant are directories. In this case we want to use GNU tar's default --overwrite-dir behavior, but unpackLayer's metadata handling is currently very weak so I've left it at "don't delete the old directory". The reworked directory case also fixes a minor bug from 44210d0 (cmd/oci-image-tool: fix unpacking..., 2016-07-22, #177) where the: if fi, err := os.Lstat(path); !(err == nil && fi.IsDir()) { block would not error out if the Lstat failed for a reason besides the acceptable IsNotExist. Instead, it would attempt to call MkdirAll, which would probably fail for the same reason that Lstat failed (e.g. ENOTDIR). But it's better to handle the Lstat errors directly. [1]: opencontainers/image-spec#317 [2]: https://github.com/opencontainers/image-spec/pull/317/files#r79214718 [3]: https://www.gnu.org/software/tar/manual/html_node/Dealing-with-Old-Files.html Signed-off-by: W. Trevor King <wking@tremily.us>
Mashimiao
reviewed
Nov 9, 2017
image/doc.go
Outdated
| // limitations under the License. | ||
|
|
||
| // Package image defines methods for validating, and unpacking OCI images. | ||
| // Package image defines methods for validating, unpacking OCI images and creating runtime bundle. |
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
1 similar comment
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: zhouhao zhouhao@cn.fujitsu.com