Skip to content

Bug 1866437: skip TLS option for pulling indexes #402

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

Merged
merged 3 commits into from
Aug 20, 2020

Conversation

ankitathomas
Copy link
Contributor

Description of the change:
Extending skipTLS option to allow opm to fetch index images from insecure registries with containerd

Motivation for the change:
When using an insecure registry in a dev environment, opm passes the skipTLS option only for pulling of bundles from the registry. Any processing of pre-existing index images requires using docker as a pull tool, since it allows pulling from insecure registries as a default. This PR passes the skipTLS option to pulling of the index images as well, removing the need for having docker as a requirement for working with insecure registries.

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

@dinhxuanvu
Copy link
Member

/hold

@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 Jul 30, 2020
@dinhxuanvu
Copy link
Member

/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 Jul 30, 2020
@Bowenislandsong
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2020
@dinhxuanvu
Copy link
Member

/lgtm

@ecordell
Copy link
Member

ecordell commented Aug 1, 2020

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2020
@openshift-bot
Copy link
Contributor

/retest

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

15 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-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-bot
Copy link
Contributor

/retest

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

@ankitathomas
Copy link
Contributor Author

/retest

@ankitathomas ankitathomas changed the title skip TLS option for pulling indexes Bug 1866437: skip TLS option for pulling indexes Aug 11, 2020
@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label Aug 11, 2020
@openshift-ci-robot
Copy link

@ankitathomas: This pull request references Bugzilla bug 1866437, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.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 1866437: skip TLS option for pulling indexes

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 Aug 11, 2020
@exdx
Copy link
Member

exdx commented Aug 11, 2020

Is it worth adding a one line log output when running opm commands with the tls-skip flag telling the user this is insecure?

I suppose their intent is already known, based on them including the flag in their command, but maybe its worth reinforcing that this is insecure and for development purposes only?

Comment on lines +182 to +184
CaFile string
SkipTLS bool
Copy link
Member

Choose a reason for hiding this comment

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

This has got me thinking: do we want to set a custom CA and TLS settings per-request, or for all requests an indexer makes? I don't think we need to change this here, but worth remember for future refactoring.

}
}

func (r *ContainerCommandRunner) argsForCmd(cmd string, args ...string) []string {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

an alternative approach would be to have a CommandBuilder abstraction to incrementally build out a command and execute it.

func (r *ContainerCommandRunner) argsForCmd(cmd string, args ...string) []string {
cmdArgs := []string{cmd}
switch r.containerTool {
case PodmanTool:
Copy link
Member

Choose a reason for hiding this comment

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

Don't we also need to do this for docker?

Copy link
Contributor Author

@ankitathomas ankitathomas Aug 12, 2020

Choose a reason for hiding this comment

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

The docker daemon itself maintains a list of insecure remote registries it can talk to, so we'd have to re-run the daemon with a new list of registries if we wanted to support those. Insecure registries on localhost are fine though, we don't need to do anything special with the client for that.

@ankitathomas
Copy link
Contributor Author

/retest

@ankitathomas ankitathomas force-pushed the skiptls branch 2 times, most recently from 3163afe to 3e11895 Compare August 18, 2020 14:07
@kevinrizza
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 18, 2020
@ankitathomas
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 Aug 20, 2020
@openshift-merge-robot openshift-merge-robot merged commit 0deaced into operator-framework:master Aug 20, 2020
@openshift-ci-robot
Copy link

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

In response to this:

Bug 1866437: skip TLS option for pulling indexes

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

10 participants