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

cmd/operator-sdk: add bundle validate command #2411

Merged
merged 3 commits into from Jan 22, 2020

Conversation

estroz
Copy link
Member

@estroz estroz commented Jan 16, 2020

Description of the change:

  • cmd/operator-sdk/bundle: the 'bundle validate' command is a CLI wrapper for operator-registry bundle content and format validators

Motivation for the change: bundle validate can be run on a bundle image manually built after running bundle build --generate-only.

@estroz estroz added the olm-integration Issue relates to the OLM integration label Jan 16, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 16, 2020
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 16, 2020
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.

Just a few nits + fix ci, otherwise it shows fine for me.
Should not the WIP be removed? What is missing get done?

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2020
@camilamacedo86 camilamacedo86 removed the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2020
@exdx
Copy link
Member

exdx commented Jan 16, 2020

LGTM, just some small comments

@estroz estroz force-pushed the feature/bundle-validate-cli branch from 11d3dcf to fae504d Compare January 17, 2020 20:07
@estroz
Copy link
Member Author

estroz commented Jan 17, 2020

/hold

Waiting on operator-framework/operator-registry#146 to update go.mod.

@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 Jan 17, 2020
@estroz estroz changed the title [WIP] cmd/operator-sdk: add bundle validate command cmd/operator-sdk: add bundle validate command Jan 17, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 17, 2020
Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/lgtm

Just one question. But it seems like any change to fix that, if necessary, would be in operator-registry.

logger := log.WithFields(log.Fields{"container-tool": c.imageBuilder})
log.SetLevel(log.DebugLevel)
val := bundle.NewImageValidator(c.imageBuilder, logger)
if err = val.PullBundleImage(c.imageTag, dir); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Does this command work if I have a bundle image on my local system and I haven't pushed it to a registry yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently not. I tested this command with a few images: local ones all returning the same error, while registry images were fine. I'll add a note here.

Additionally error messages can be improved in PullBundleImage, as right now the only message I'm seeing is exit status 1 @exdx @dinhxuanvu.

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Jan 17, 2020
@openshift-ci-robot
Copy link

New changes are detected. LGTM label has been removed.

CLI wrapper for operator-registry bundle content and format
validators

go.mod,go.sum: pin operator-registry commit containing validation
functions

doc/cli: regenerate

CHANGELOG.md: add bundle validate addition
@estroz estroz force-pushed the feature/bundle-validate-cli branch from 8eee978 to 4c28290 Compare January 21, 2020 22:08
@estroz
Copy link
Member Author

estroz commented Jan 21, 2020

/hold cancel

@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 Jan 21, 2020
@estroz estroz merged commit e531b91 into operator-framework:master Jan 22, 2020
@estroz estroz deleted the feature/bundle-validate-cli branch January 22, 2020 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
olm-integration Issue relates to the OLM integration size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants