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

Allow TLS flags to be disabled #1440

Merged
merged 4 commits into from
Aug 4, 2021

Conversation

rubenvp8510
Copy link
Collaborator

@rubenvp8510 rubenvp8510 commented Apr 28, 2021

Fixes #1438

Signed-off-by: Ruben Vargas [email protected]

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #1440 (b447b2a) into master (9808586) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head b447b2a differs from pull request most recent head 20dfd0a. Consider uploading reports for the commit 20dfd0a to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1440   +/-   ##
=======================================
  Coverage   87.70%   87.70%           
=======================================
  Files          93       93           
  Lines        5838     5839    +1     
=======================================
+ Hits         5120     5121    +1     
  Misses        552      552           
  Partials      166      166           
Impacted Files Coverage Δ
pkg/deployment/agent.go 100.00% <100.00%> (ø)
pkg/deployment/all_in_one.go 100.00% <100.00%> (ø)
pkg/deployment/collector.go 100.00% <100.00%> (ø)
pkg/inject/sidecar.go 97.46% <100.00%> (ø)

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 9808586...20dfd0a. Read the comment docs.

Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

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

Could you please confirm that you ran a manual test like the following?

  • On OpenShift, create a simple CR. This should enable TLS by default
  • Change the CR to disable TLS
  • Check that the CR (and underlying Jaeger config) look sane and without extra options like paths to the certs and keys.

ca.Update(a.jaeger, commonSpec)
ca.AddServiceCA(a.jaeger, commonSpec)
if len(util.FindItem("--collector.grpc.tls.enabled", options)) == 0 {
tls.Update(a.jaeger, commonSpec, &options)
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't feel right: if the option is set, then tls.Update will be skipped (and ca, and ca.AddServiceCA). Why did we have this as part of all reconciliation loops before? What happens when on the first reconciliation we did not have this parameter, causing the operator to add --reporter.grpc.tls.enabled=true, and the user then manually sets this to false?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I need to test this case,

I ran manually tests only for the first case, I'll check what happens in the case of an update to the CR. but it seems like you're right.

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you test this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tested it with the last changes I did, it seems to work fine.

@rubenvp8510
Copy link
Collaborator Author

I did some changes to only touch the flags in case of the TLS certificates, still creating CA on the reconciliation, regarding of the flags.

@rubenvp8510 rubenvp8510 requested a review from jpkrohling May 11, 2021 21:25
Copy link
Contributor

@jpkrohling jpkrohling 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 good, but it's not still clear to me what happens when a collector is first provisioned with the TLS options, and then has the TLS options disabled. Did you test this case? Is it possible to simulate this with an e2e test?

ca.Update(a.jaeger, commonSpec)
ca.AddServiceCA(a.jaeger, commonSpec)
if len(util.FindItem("--collector.grpc.tls.enabled", options)) == 0 {
tls.Update(a.jaeger, commonSpec, &options)
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you test this case?

@jpkrohling
Copy link
Contributor

@rubenvp8510 could you please rebase this?

@rubenvp8510
Copy link
Collaborator Author

rubenvp8510 commented Jul 30, 2021

This looks good, but it's not still clear to me what happens when a collector is first provisioned with the TLS options, and then has the TLS options disabled. Did you test this case? Is it possible to simulate this with an e2e test?

The TLS will be disabled, but all the volumes will be still there. I'll add an E2E test, may be we can do it in another PR?

@jpkrohling jpkrohling changed the title Validate presence of tls flags using only the prefix of the flag Allow TLS flags to be disabled Aug 4, 2021
@jpkrohling jpkrohling enabled auto-merge (squash) August 4, 2021 09:20
@jpkrohling jpkrohling merged commit 05b0c69 into jaegertracing:master Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabling TLS in the collector keeps tls=true option
2 participants