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

bundle validate: add tool-less image validation #3222

Merged

Conversation

estroz
Copy link
Member

@estroz estroz commented Jun 12, 2020

Description of the change:

  • cmd/operator-sdk/bundle/validate.go: add "none" option to available image builder tools

Motivation for the change: ImageValidator can now use a containerd image ("none") tool to unpack images, removing the need for an external image tool like docker/podman.

/cc @hasbro17 @jmccormick2001 @joelanford

Blocked by #3221

/kind feature

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 12, 2020
"One of: [docker, podman]")
"Tool to pull and unpack bundle images. Only used when validating a bundle image. "+
"One of: [docker, podman, none]")

fs.StringVarP(&c.outputFormat, "output", "o", internal.Text,
Copy link
Contributor

Choose a reason for hiding this comment

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

when we call the bundle validation with the --image-builder and then bundle is in the disk (created with the generated-only) it is not WARNING that the value will be ignored or raising and error telling that the flag is invalid. Could we add that?

Copy link
Member Author

Choose a reason for hiding this comment

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

We should either fail if that flag is set or do nothing, but that's something to do in a follow-up.

Comment on lines +137 to +138
"Tool to pull and unpack bundle images. Only used when validating a bundle image. "+
"One of: [docker, podman, none]")
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we need to make clear that it is not a valid option when the bundle was created with the flag --generate-only . We know that when this flag is used an image is not created and in this way, it is not valid forOnly used when validating a bundle image.

However, we can make the info more implicit and directly instead of assuming that they will come this conclusion easily.

Suggested change
"Tool to pull and unpack bundle images. Only used when validating a bundle image. "+
"One of: [docker, podman, none]")
"Tool to pull and unpack bundle images. Bundles created with --generate-only has not images and this option is just useful with bundle images. "+
"One of: [docker, podman, none]")

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the original is more clear, especially considering that this command can be used with non-SDK-generated bundles.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we need to make clear that it is not valid for the bundle created with the flag --generate-only explicitly, however, I am ok with any rephrase to address that.

@@ -56,7 +56,7 @@ To build and validate an image:

```
-h, --help help for validate
-b, --image-builder string Tool to extract bundle image data. Only used when validating a bundle image. One of: [docker, podman] (default "docker")
-b, --image-builder string Tool to pull and unpack bundle images. Only used when validating a bundle image. One of: [docker, podman, none] (default "docker")
Copy link
Contributor

Choose a reason for hiding this comment

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

I can use podman or docker to validate the image .. however, to create a can just use docker. Should we not be a valid option to create the bundle as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

You can use docker, podman, or buildah to create the bundle image (see help text of bundle create). I think the --image-builder name is confusing and should be changed to --container-tool or something. Needs a follow-up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I liked --container-tool

images, removing the need for an external image tool like docker/podman.
`bundle validate` should have this functionality.

cmd/operator-sdk/bundle/validate.go: add "none" option to available
image builder tools
@estroz estroz force-pushed the feature/bundle-validate-none-tool branch from a3acb91 to ee8ac5a Compare June 12, 2020 18:03
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

I am ok with we move with and address the comments in follow-ups. Could you please track an issue for one of them before we merge this one to ensure that they will not get lost?

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2020
@estroz estroz merged commit 4df98c8 into operator-framework:master Jun 22, 2020
@estroz estroz deleted the feature/bundle-validate-none-tool branch June 22, 2020 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. 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

3 participants