Skip to content
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

Bug 1841178: fix(images): use docker/podman create and cp for exec unpacking #351

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

njhale
Copy link
Member

@njhale njhale commented Jun 8, 2020

Use docker/podman create and cp commands to unpack bundle and index
images instead of a custom unpacking scheme. This fixes an issue where
whiteout files present in an image cause opm alpha bundle validate to
fail.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: njhale

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2020
Copy link
Member

@kevinrizza kevinrizza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment, otherwise this looks great. Nice job!

err error
)

tool := containertools.NewContainerTool(imageBuilderArgs, containertools.NoneTool)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the help text for this flag lists docker and podman and is a "build" tool. Can we update the help text to at least mention the none option? I think if we did that we should also probably attempt to rename the parameter, since we aren't building anything in bundle validate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -101,6 +102,49 @@ func (r *ContainerCommandRunner) Save(image, tarFile string) error {
return nil
}

// Unpack copies a directory from a local container image to a directory in the local filesystem.
func (r *ContainerCommandRunner) Unpack(image, src, dst string) error {
args := []string{"create", image, ""}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -101,6 +102,49 @@ func (r *ContainerCommandRunner) Save(image, tarFile string) error {
return nil
}

// Unpack copies a directory from a local container image to a directory in the local filesystem.
func (r *ContainerCommandRunner) Unpack(image, src, dst string) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this replace Save entirely? I don't think we want to use save at all, unless I am missing a case where we want it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point; it should. I'll drop Save in favor of Unpack.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Use docker/podman create and cp commands to unpack bundle and index
images instead of a custom unpacking scheme. This fixes an issue where
whiteout files present in an image cause `opm alpha bundle validate` to
fail.
@kevinrizza
Copy link
Member

/lgtm
/hold for second review

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2020
@ecordell
Copy link
Member

ecordell commented Jun 9, 2020

/hold cancel
/lgtm

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 9, 2020
@ecordell
Copy link
Member

ecordell commented Jun 9, 2020

/refresh

@openshift-merge-robot openshift-merge-robot merged commit b8292cc into operator-framework:master Jun 9, 2020
@njhale njhale changed the title fix(images): use docker/podman create and cp for exec unpacking Bug 1841178: fix(images): use docker/podman create and cp for exec unpacking Jun 9, 2020
@openshift-ci-robot
Copy link

@njhale: All pull requests linked via external trackers have merged: . Bugzilla bug 1841178 has been moved to the MODIFIED state.

In response to this:

Bug 1841178: fix(images): use docker/podman create and cp for exec unpacking

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@njhale
Copy link
Member Author

njhale commented Jun 9, 2020

/cherry-pick release-4.5

@openshift-cherrypick-robot

@njhale: new pull request created: #352

In response to this:

/cherry-pick release-4.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants