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 1829994: Index generate dameonless #314

Conversation

kevinrizza
Copy link
Member

Enable daemonless index add when --generate is specified.

This also fixes a bug where, on multiple runs with --generate specified, the database would fail to build.

Doing this with a partial implementation to unblock podman users to be able to generate the database without shelling out to podman and hitting this bug containers/podman#5234. In the future, this implementation should be fleshed out so that all of the registry and index commands make this distinction between pull and build runners.

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. label Apr 30, 2020
@openshift-ci-robot
Copy link

@kevinrizza: This pull request references Bugzilla bug 1829994, 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 ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1829994: Index generate dameonless

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 Apr 30, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 30, 2020
Copy link
Member

@gallettilance gallettilance left a comment

Choose a reason for hiding this comment

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

\lgtm

Copy link
Member

@gallettilance gallettilance left a comment

Choose a reason for hiding this comment

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

Should we write a test that specifically uses shas?

@kevinrizza
Copy link
Member Author

/retest

indexCmd.Flags().StringP("tag", "t", "", "custom tag for container image being built")
indexCmd.Flags().Bool("permissive", false, "allow registry load errors")
indexCmd.Flags().StringP("mode", "", "replaces", "graph update mode that defines how channel graphs are updated. One of: [replaces, semver, semver-skippatch]")
indexCmd.Flags().String("container-tool", "", "container-tool has been deprecated. Please select a build and pull tool separately.")
Copy link
Member

Choose a reason for hiding this comment

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

Note for later: cobra has a way to mark options as deprecated:

indexCmd.Flags().StringP("container-tool", "c", "podman", "tool to interact with container images (save, build, etc.). One of: [docker, podman]")
if err := rootCmd.Flags().MarkDeprecated("container-tool", "ignored in favor of separate build-tool and pull-tool options"); err != nil {
		logrus.Panic(err.Error())
}

This has some nice properties like preserving the help when referenced, but omitting it from the standard help output.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, nice. I'll update this to include it.

return err
}

if containerTool != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Any thoughts on how backwards compatible we want to be? If we explode here we end up breaking existing clients. Though we can do a major version bump after to be dogmatic about semver.

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 was sort of back and forth on this. I think that's fair, maybe we want to just treat this as an alias and use it to overwrite defaults if the two new flags haven't been specified?

Copy link
Member

Choose a reason for hiding this comment

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

SGTM, but is there a convention for telling the difference between unset and set-to-default?

@Bowenislandsong
Copy link
Member

/lgtm
/hold
holding 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 May 1, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 1, 2020
@dinhxuanvu
Copy link
Member

/lgtm

@dinhxuanvu
Copy link
Member

/retest

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label May 1, 2020
@kevinrizza
Copy link
Member Author

@ecordell updated based on your thoughts. ptal.

pkg/lib/indexer/indexer.go Show resolved Hide resolved
pkg/lib/indexer/indexer.go Show resolved Hide resolved
Multiple runs of index add when --generate is specified because the
db file cannot be cleaned up. To account for this, update the
copyDatabaseTo function to not return when the parent folder already
exists and overwrite the actual database when doing io.Copy()
Enable daemonless pull by default on indexes. When no build happens,
this makes opm index add daemonless
Copy link
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.

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell, gallettilance, kevinrizza

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:
  • OWNERS [ecordell,kevinrizza]

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

@kevinrizza
Copy link
Member 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 1, 2020
@kevinrizza
Copy link
Member Author

/test e2e-aws

@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 e4773b9 into operator-framework:master May 1, 2020
@openshift-ci-robot
Copy link

@kevinrizza: All pull requests linked via external trackers have merged: operator-framework/operator-registry#314. Bugzilla bug 1829994 has been moved to the MODIFIED state.

In response to this:

Bug 1829994: Index generate dameonless

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-urgent Referenced Bugzilla bug's severity is urgent 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

9 participants