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

fix: Default to insecure mode when no certs are present #5511

Merged
merged 6 commits into from
Mar 26, 2021

Conversation

simster7
Copy link
Member

@simster7 simster7 commented Mar 25, 2021

Fixes #5466

Signed-off-by: Simon Behar simbeh7@gmail.com

Checklist:

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #5511 (2f56c8c) into master (b8af341) will increase coverage by 0.25%.
The diff coverage is 14.28%.

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

@@            Coverage Diff             @@
##           master    #5511      +/-   ##
==========================================
+ Coverage   46.69%   46.95%   +0.25%     
==========================================
  Files         240      240              
  Lines       15004    15011       +7     
==========================================
+ Hits         7006     7048      +42     
+ Misses       7102     7066      -36     
- Partials      896      897       +1     
Impacted Files Coverage Δ
cmd/argo/commands/server.go 34.51% <14.28%> (+34.51%) ⬆️
workflow/metrics/server.go 12.50% <0.00%> (-4.17%) ⬇️
cmd/argoexec/commands/emissary.go 48.43% <0.00%> (-1.57%) ⬇️
workflow/controller/operator.go 70.96% <0.00%> (+0.27%) ⬆️
cmd/argo/commands/get.go 56.66% <0.00%> (+0.66%) ⬆️

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 b8af341...ea74beb. Read the comment docs.

@alexec
Copy link
Contributor

alexec commented Mar 25, 2021

I don’t think understand why so many users broken. Are you sure v3 works with —secure=true? Why was it breaking? These files are on the image. Could it be we need to backport of fix something else?

@simster7
Copy link
Member Author

I don’t think understand why so many users broken. Are you sure v3 works with —secure=true? Why was it breaking? These files are on the image. Could it be we need to backport of fix something else?

I believe a lot of users download the binary from GitHub (not a Docker image) and run argo server from their own command lines. In those cases, the self-signed certs are not available. Since this used to work before, many users are surprised when it suddenly does not.

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 changed the title fix: Add hint to start in insecure mode when no certs are present fix: Default to insecure mode when no certs are present Mar 26, 2021
Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7
Copy link
Member Author

@alexec Addressed per your comments in #5466 (comment)

@simster7 simster7 requested a review from alexec March 26, 2021 15:21
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

Wouldn’t it be easier just to do io.Stat on line 158?

@simster7
Copy link
Member Author

Wouldn’t it be easier just to do io.Stat on line 158?

Sorry @alexec, could I ask you to clarify what you mean? It's not clear which line of code do you mean by "line 158" based on the numbering from this PR's file changes

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@alexec
Copy link
Contributor

alexec commented Mar 26, 2021

Wouldn’t it be easier just to do io.Stat on line 158?

Sorry @alexec, could I ask you to clarify what you mean? It's not clear which line of code do you mean by "line 158" based on the numbering from this PR's file changes

It is like 158 before modification.

Something like:

_, err := os.Stat("argo-server.crt")
command.Flags().BoolVarP(&secure, "secure", "e", !os.IsNotFoundErr(err), "Whether or not we should listen on TLS.")

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7
Copy link
Member Author

@alexec Clever, I like that. Changed

-----END PRIVATE KEY-----
`

func TestDefaultSecureMode(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice work!

Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 merged commit a61d84c into argoproj:master Mar 26, 2021
This was referenced Mar 29, 2021
simster7 added a commit that referenced this pull request Mar 30, 2021
Signed-off-by: Simon Behar <simbeh7@gmail.com>
@simster7 simster7 mentioned this pull request Apr 19, 2021
50 tasks
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.

Argo- v3.0.0-rc8 has issues with argo server
2 participants