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 1827544: provide better defaults for oc adm catalog build #423

Merged
merged 2 commits into from May 29, 2020

Conversation

ecordell
Copy link
Contributor

@ecordell ecordell commented May 15, 2020

  • will try to find the base image to use from an existing ocp connection or release image
  • will throw an error if it can't find a base image from a release or explicitly with --from
  • will default to linux/amd64 for the base image arch when building

@ecordell ecordell changed the title provide better defaults for oc adm catalog build Bug 1827544: provide better defaults for oc adm catalog build May 15, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. label May 15, 2020
@openshift-ci-robot
Copy link

@ecordell: This pull request references Bugzilla bug 1827544, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1827544: provide better defaults for oc adm catalog build

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label May 15, 2020
@ecordell
Copy link
Contributor Author

/hold

I'm going to change this to grab the base image from a target ocp release

@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 May 15, 2020
@ecordell
Copy link
Contributor Author

/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 May 15, 2020
@openshift-ci-robot
Copy link

@ecordell: This pull request references Bugzilla bug 1827544, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1827544: provide better defaults for oc adm catalog build

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.

pkg/cli/admin/catalog/build.go Outdated Show resolved Hide resolved
pkg/cli/admin/catalog/build.go Outdated Show resolved Hide resolved
pkg/cli/admin/catalog/build.go Outdated Show resolved Hide resolved
pkg/cli/admin/catalog/build.go Show resolved Hide resolved
@ecordell ecordell force-pushed the oc-catalog-baseimage branch 3 times, most recently from 44fe2be to fbe679e Compare May 26, 2020 13:50
@ecordell
Copy link
Contributor Author

/retest

@ecordell
Copy link
Contributor Author

ecordell commented May 26, 2020

/retest

gce error: lookupDiskImageSources

Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Can you explain why we need a new flag, when --from and --release-image exclude each other? Or am I misreading the intention here, but the code clearly gives precedence to --from if both are specified. Which means you should be able to pass whatever you wanted through --from, no?

pkg/cli/admin/catalog/build.go Outdated Show resolved Hide resolved
pkg/cli/admin/catalog/build.go Show resolved Hide resolved
@ecordell
Copy link
Contributor Author

Which means you should be able to pass whatever you wanted through --from, no?

Yes, you can pass whatever you want as a base image.

Typically you'll want to pick the base image from a release, but there are cases where that's not what you want (you might want to pick a newer image to fix a bug, or you might want be targeting an upstream cluster, or you might be QE testing different variants).

So the order is: if you've told us the base image (--from) we'll use that, or if you've told us a specific release (--release-image) we'll use the image from that, or we'll try to figure out a good base image from the cluster you're logged into.

@soltysh
Copy link
Member

soltysh commented May 27, 2020

So the order is: if you've told us the base image (--from) we'll use that, or if you've told us a specific release (--release-image) we'll use the image from that, or we'll try to figure out a good base image from the cluster you're logged into.

If that's the case, I still think all of that should be baked in one flag, having more is just confusing for user as in which one should I use, what happens if both are set, etc. Having a single gives simple information - that's the one we use, or we default to a cluster.

- will try to pick a base image from a release
- will default to linux/amd64 for the base image arch when building
@ecordell ecordell force-pushed the oc-catalog-baseimage branch 2 times, most recently from 141a930 to c5b9ac6 Compare May 27, 2020 20:54
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

Two more nits, but I like this, thx!
/approve

@@ -26,16 +29,36 @@ var (

Extracts the contents of a collection of operator manifests to disk, and builds them into
an operator registry catalog image.

The base image used for the catalog should match the target version of ocp. This can be set manually with
the '--from' flag, or it can be inferred from an ocp release image via '--release-image', or directly from
Copy link
Member

Choose a reason for hiding this comment

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

You left --release-image mentioned here.

@@ -113,7 +184,7 @@ func NewBuildImage(streams genericclioptions.IOStreams) *cobra.Command {
o.FilterOptions.Bind(flags)
o.ParallelOptions.Bind(flags)

flags.StringVar(&o.From, "from", o.From, "The image to use as a base.")
flags.StringVar(&o.From, "from", o.From, "The image to use as a base. This can be omitted if `--release-image` is specified or if oc is already logged into the target cluster.")
Copy link
Member

Choose a reason for hiding this comment

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

Again --release-image being mentioned.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2020
this removes the release-image flag and instead detects whether the
targeted image is a release image
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, soltysh

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

@ecordell
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@ecordell
Copy link
Contributor Author

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 9933eb9 into openshift:master May 29, 2020
@openshift-ci-robot
Copy link

@ecordell: All pull requests linked via external trackers have merged: openshift/oc#423. Bugzilla bug 1827544 has been moved to the MODIFIED state.

In response to this:

Bug 1827544: provide better defaults for oc adm catalog build

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. 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

5 participants