Skip to content

Conversation

@jpower432
Copy link
Contributor

The skip-tls flag currently uses HTTP instead of the expected behavior of skipping
TLS cert validated with HTTPS registries. The new flags seperate untrusted HTTPS from
HTTP registries and behave as expected

Signed-off-by: Jennifer Power barnabei.jennifer@gmail.com

Description of the change:
This PR deprecated the skip-tls flag and create two new flags, skip-tls-verify and use-http. The new flags disable TLS validation, use plain HTTP, respectively.

Motivation for the change:
The motivation for the changed is resolve the confusion due to the skip-tls flag description and to allow the use of self-signed or untrusted HTTPS when using opm

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

Related to #872

@openshift-ci openshift-ci bot requested review from benluddy and joelanford January 14, 2022 21:44
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 14, 2022

Hi @jpower432. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2022
@jpower432
Copy link
Contributor Author

cc @dinhxuanvu

@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #898 (14d600d) into master (f7e2773) will decrease coverage by 0.02%.
The diff coverage is 24.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #898      +/-   ##
==========================================
- Coverage   52.18%   52.16%   -0.03%     
==========================================
  Files         103      103              
  Lines        9094     9108      +14     
==========================================
+ Hits         4746     4751       +5     
- Misses       3442     3451       +9     
  Partials      906      906              
Impacted Files Coverage Δ
pkg/lib/indexer/indexer.go 10.61% <0.00%> (-0.18%) ⬇️
pkg/lib/registry/registry.go 18.39% <0.00%> (-0.36%) ⬇️
pkg/lib/bundle/exporter.go 62.85% <100.00%> (+6.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7e2773...14d600d. Read the comment docs.

@dinhxuanvu
Copy link
Member

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 17, 2022
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 17, 2022
@dinhxuanvu
Copy link
Member

@joelanford Would you mind taking a look? Thanks

Comment on lines 95 to 99
if skipTLS {
// Set useHTTP when use deprecated skipTlS
// for functional parity with existing
useHTTP = true
}
Copy link
Member

Choose a reason for hiding this comment

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

What happens if someone uses --skip-tls=true --use-http=false? Should we error out in that case?

Maybe even better, should we just make skip-tls mutually exclusive from both skip-tls-verify and use-http?

Copy link
Member

Choose a reason for hiding this comment

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

Also, it seems like --skip-tls-verify=false --use-http=true is an invalid combination, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree with doing the flag combination checks. My intent here was to make it simpler to rip out skip-tls eventually because it is being deprecated here, but I see how doing that might introduce some unexpected changes since it may not always equate to use-http in every case. I will make that change.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure if it's possible, but given this code is repeated in so many places, it might be worth taking a look at writing a helper function somewhere in the cmd tree (perhaps cmd/internal/util or something?) so it can be reused everywhere.

The skip-tls flag currently uses HTTP instead of the expected behavior of skipping
TLS cert validated with HTTPS registries. The new flags seperate untrusted HTTPS from
HTTP registries and behave as expected

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
…mmand

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@dinhxuanvu
Copy link
Member

@joelanford Ready for the final review.

@joelanford
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 20, 2022
@openshift-merge-robot openshift-merge-robot merged commit 354cd38 into operator-framework:master Jan 20, 2022
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants