Skip to content

Add bundle library to build bundle manifest image#97

Merged
openshift-merge-robot merged 7 commits intooperator-framework:masterfrom
dinhxuanvu:bundle-lib
Oct 28, 2019
Merged

Add bundle library to build bundle manifest image#97
openshift-merge-robot merged 7 commits intooperator-framework:masterfrom
dinhxuanvu:bundle-lib

Conversation

@dinhxuanvu
Copy link
Copy Markdown
Member

@dinhxuanvu dinhxuanvu commented Oct 11, 2019

  1. Add top level CLI command opm
  2. Add bundle command to generate annotations.yaml and Dockerfile
  3. Add bundle command to build Bundle image
  • The build command will generate annotations.yaml and Dockerfile
    as well

Signed-off-by: Vu Dinh vdinh@redhat.com

Description of the change:

Motivation for the change:

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 11, 2019
@alecmerdler alecmerdler removed their request for review October 11, 2019 05:19
@kevinrizza
Copy link
Copy Markdown
Member

@dinhxuanvu won't this break the makefile because you are nesting an additional package into the cmd folder that doesn't compile directly? I think make build relies on go list to get its list to compile.

@dinhxuanvu dinhxuanvu changed the title Add bundle library to build bundle manifest image [WIP] Add bundle library to build bundle manifest image Oct 11, 2019
@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 Oct 11, 2019
@dinhxuanvu
Copy link
Copy Markdown
Member Author

@kevinrizza This is just a cherry-pick PR from original PR in OLM repo. I'm working on separating the functional code into an actual package under pkg and cli/cobra code remaining in /cmd for internal use. Stay tuned.

@dinhxuanvu dinhxuanvu changed the title [WIP] Add bundle library to build bundle manifest image Add bundle library to build bundle manifest image Oct 17, 2019
@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 Oct 17, 2019
@dinhxuanvu dinhxuanvu force-pushed the bundle-lib branch 3 times, most recently from 93c3351 to 9b53535 Compare October 17, 2019 07:07
@dinhxuanvu
Copy link
Copy Markdown
Member Author

/test unit

Comment thread docs/design/operator-bundle.md Outdated
Copy link
Copy Markdown
Member

@ecordell ecordell left a comment

Choose a reason for hiding this comment

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

This looks great! Tests and docs are great as well.

I have one comment on the labels for future-proofing, but once you make those changes we should merge 🎉

@ecordell
Copy link
Copy Markdown
Member

Ah, one issue to resolve for the tests:

pkg/lib/bundle/build_test.go:55:27: cmd.String undefined (type *exec.Cmd has no field or method String) 

@ecordell
Copy link
Copy Markdown
Member

/retest

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 22, 2019
@dinhxuanvu dinhxuanvu force-pushed the bundle-lib branch 2 times, most recently from 693e669 to 24a26d3 Compare October 22, 2019 07:45
@dinhxuanvu
Copy link
Copy Markdown
Member Author

/retest

Copy link
Copy Markdown
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.

Nice job on this! I just had a few small comments.

Comment thread cmd/opm/bundle/generate.go Outdated
Comment thread pkg/lib/bundle/build.go
Comment thread cmd/opm/bundle/build.go

bundleBuildCmd.Flags().StringVarP(&imageBuilderArgs, "image-builder", "b", "docker", "Tool to build container images. One of: [docker, podman, buildah]")

bundleBuildCmd.Flags().StringVarP(&channelDefaultArgs, "default", "e", "", "The default channel for the bundle image")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe defaultChannel is a better name here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The defaultChannel is a fine name but the reason I use default here is to keep the command flag to be as short as possible. Long name only makes the command even longer and difficult to read. I try to keep all flags to be single word with the exception of image-builder because SDK has the a flag with that name with the same functionality. So I decided to keep it the same as SDK to keep the consistency given this command will be added to SDK.

Comment thread cmd/opm/bundle/build.go Outdated
Comment thread cmd/opm/bundle/build.go Outdated
@kevinrizza
Copy link
Copy Markdown
Member

Sorry one more request @dinhxuanvu , can you squash your commits? There's a lot of old history that isn't really relevant anymore.

@dinhxuanvu dinhxuanvu force-pushed the bundle-lib branch 2 times, most recently from 89f5204 to 6c117a3 Compare October 23, 2019 18:04
Vu Dinh added 5 commits October 23, 2019 14:06
1. Add top level CLI command `operator-cli`
2. Add bundle command to generate annotations.yaml and Dockerfile
3. Add bundle command to build Bundle image
* The build command will generate annotations.yaml and Dockerfile
as well
4. Add unit test cases for operator bundle commands
5. Add operator bundle documentation

Signed-off-by: Vu Dinh <vdinh@redhat.com>
1. Move bundle funcs to /pkg as a bundle package

2. ix some minor errors in unit test.

3. Modify bundle doc to reflect recent changes

+ operator-sdk information
+ Folder structure

4. Add bundle command to opm binary as hidden commands

+ The bundle commands are only available for internal development use
as a part of opm binary.

5. Move bundle doc under /docs/design.

Signed-off-by: Vu Dinh <vdinh@redhat.com>
1. Package name, channels, default channel info is now added to
annotations.yaml
2. `bundle generate` will retain overwritten ability while `bundle
build` will only overwrite Dockerfile.
3. Validate annotations.yaml if existed.
4. `--overwrite/o` flag is available to overwrite annotations.yaml
during build command.

Signed-off-by: Vu Dinh <vdinh@redhat.com>
Signed-off-by: Vu Dinh <vdinh@redhat.com>
Signed-off-by: Vu Dinh <vdinh@redhat.com>
@dinhxuanvu dinhxuanvu force-pushed the bundle-lib branch 2 times, most recently from f033b42 to 0bb8f40 Compare October 24, 2019 02:06
@dinhxuanvu
Copy link
Copy Markdown
Member Author

Ready for another round of review.

@dinhxuanvu dinhxuanvu force-pushed the bundle-lib branch 2 times, most recently from 1ceb026 to 8037b61 Compare October 24, 2019 03:41
@kevinrizza
Copy link
Copy Markdown
Member

lgtm

Comment thread cmd/opm/alpha/bundle/build.go Outdated
Comment thread docs/design/operator-bundle.md
Comment thread docs/design/operator-bundle.md
1. Clarify a few helper texts in cli code
2. Improve librar document to specific input information
3. Move `bundle` comands under hidden `alpha` command

Signed-off-by: Vu Dinh <vdinh@redhat.com>
@gallettilance
Copy link
Copy Markdown
Member

lgtm

Comment thread pkg/lib/bundle/generate.go Outdated
Signed-off-by: Vu Dinh <vdinh@redhat.com>
@jpeeler
Copy link
Copy Markdown

jpeeler commented Oct 28, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 28, 2019
@openshift-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dinhxuanvu, jpeeler

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

The pull request process is described here

Details 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-merge-robot openshift-merge-robot merged commit cdfd65b into operator-framework:master Oct 28, 2019
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants