-
Notifications
You must be signed in to change notification settings - Fork 198
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
compose-image: Add --initialize-mode
#4598
Merged
Merged
Conversation
This file contains 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
A long time ago I did containers/skopeo@08b27fc in preparation for this change. Basically this is what we really want to be the default, but couldn't at the time: "Create a new image if one doesn't exist". For completeness though, we also add support for `always` (which is the existing `--initialize`) as well as `--never` (which ensures we never overwrite an existing image, in case someone cares). However in testing this out: it basically works OK with a registry transport which is the big one, but: - It just plain doesn't work with `.ociarchive` due to skopeo bugs - It even more unfortunately doesn't work with `oci` directories and a target image reference; e.g. `--format=oci manifest.yaml oci:foo:sometag`
cgwalters
added a commit
to cgwalters/skopeo
that referenced
this pull request
Sep 15, 2023
By adding the standard ENOENT to our list of errors. I hit this while working on coreos/rpm-ostree#4598 which is a tool that builds base images and wants to query if the image exists beforehand.
cgwalters
added a commit
to cgwalters/skopeo
that referenced
this pull request
Sep 15, 2023
By adding the standard ENOENT to our list of errors. I hit this while working on coreos/rpm-ostree#4598 which is a tool that builds base images and wants to query if the image exists beforehand. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/skopeo
that referenced
this pull request
Sep 15, 2023
By adding the standard ENOENT to our list of errors. I hit this while working on coreos/rpm-ostree#4598 which is a tool that builds base images and wants to query if the image exists beforehand. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 18, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to `ImageNotFound`, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 18, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to `ImageNotFound`, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory.
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 18, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 18, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 18, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
jmarrero
approved these changes
Sep 19, 2023
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.
lgtm
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 19, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 19, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 19, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
cgwalters
added a commit
to cgwalters/image
that referenced
this pull request
Sep 19, 2023
This is for containers/skopeo#2114 which is in turn a dependency of coreos/rpm-ostree#4598 Basically I want to map ENOENT to a clear error, because the build tooling wants to treat "target image is not present" differently from "DNS lookup failed" or "we got EPERM". There's a bit of code motion here because we need to move the `os.Open()` call before creating a temporary directory. Signed-off-by: Colin Walters <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A long time ago I did
containers/skopeo@08b27fc in preparation for this change.
Basically this is what we really want to be the default, but couldn't at the time: "Create a new image if one doesn't exist".
For completeness though, we also add support for
always
(which is the existing--initialize
) as well as--never
(which ensures we never overwrite an existing image, in casesomeone cares).
However in testing this out: it basically works OK with a registry transport which is the big one, but:
.ociarchive
due to skopeo bugsoci
directories and a target image reference; e.g.--format=oci manifest.yaml oci:foo:sometag