-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: allow Domains is empty in TLSAuth #2349
Conversation
I have paste the ca key as comment here, so we can resign or do other thing if we need. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, It's looks good to me!
Codecov Report
@@ Coverage Diff @@
## master #2349 +/- ##
==========================================
+ Coverage 72.71% 75.19% +2.47%
==========================================
Files 184 193 +9
Lines 14571 15392 +821
==========================================
+ Hits 10596 11574 +978
+ Misses 3333 3117 -216
- Partials 642 701 +59
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
56d2c8d
to
1296366
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me! 👍
By the way, may I run the CI manually before review?
Unfortunately, this is a limitation for first-time contributors. But next time should not be the case 😉
To handle this limitation, we implemented a Makefile target check that runs the linter the same version as the CI (inside the docker container) and runs the tests. For sure, it's not the same as the CI, but at least address the linter issues. I hope that helps!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rainingmaster,
the current implementation LGTM but apparently, the NameToCertificate had been deprecated which seems to be the main reason why nameToCert
exists. I think we could accept Go's suggestion and migrate to auto-detection. Does it make sense for you?
Hi @codebien
Sorry I didn't notice this, and in fact, I have use So do you mean we should remove If what I said is correct, I agree and will do it, do you mind if I implement it in the this MR? |
Hi @rainingmaster,
Unfortunately, I don't think we can do it, it would be a breaking change for the k6 API. We can deprecate it but we have to continue to support the previous code. Instead, we can support the new cases in the new method (e.g. the one you're adding). So if
It will still support the original proposal and the change will be only an internal refactor, for that I think it's totally fine to have it here. |
Hi @codebien
I see, so I think what I need to do in this MR is add a log warnings about the deprecation? Please correct me if I'm missing other points. |
@rainingmaster and init The test of your use case and the test changes added are still nice to have so we can keep them |
1296366
to
b06385e
Compare
Hi @codebien I have add a judgement here and leave some comment. However, I didn't find a good way to add a log warnings if domains is provided or |
b06385e
to
6ed455f
Compare
Hi @codebien
It is because the log will be print when we new each VU, is it acceptable? Or we should log it when new a runner? |
I saw a data race error here. I think this error was not introduced by this change, but existed before: because multiple VUs will share the same Option, there will be a competition for reading and writing here when newUV is used. |
Hi @rainingmaster,
We can use a
The data race is dependent on the test's design. The real code will invoke the Parse branch only once during the UnmarhalJSON execution. Lines 150 to 152 in 77ff732
You should be able to fix the data race invoking the Certificate method before starting the tests so just after the option set, like: opt.TLSAuth = []*lib.TLSAuth{
...
opt.TLSAuth[0].Certificate() |
Hi @codebien. Thanks for your reply. In fact I am doing some job with this PR when you response it, lol.
Do you mean we add a
Thanks for your remind, I just notice this point. I will improve it. |
6ed455f
to
1f80ede
Compare
Hi @codebien
instead of
And we can get handle these logic (all |
By the way, I didn't find a good place to add the |
1f80ede
to
081a1c6
Compare
Hi @codebien , could you help me review it when you free? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rainingmaster, thanks for your effort on this PR, and sorry for my late response, I was busy with other topics. I added some comments.
It could be good for you to know that we have make lint
and make tests
commands that mostly replicate the CI jobs, run them before pushing so you can get faster feedback about your code.
081a1c6
to
4deb997
Compare
Cool, this is reasonable. I have revert to the old version and add the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good to me, just a simple comment
4deb997
to
ea03b23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rainingmaster excellent work 👍 Thanks again for the contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rainingmaster,
it should be nice to mention what are the plans on the nolint
directive. After that, I think we should be mostly ready to merge this PR at the beginning of the next week when the v0.38 cycle will start.
ea03b23
to
0b6d759
Compare
Hi @codebien , could you help me review again? Thx! |
Hi, I found when I set the option like this, the certificates won't be pass to server, and have no error will be reported:
I think it is reasonable to allow user set an empty
domains
filed, so I raise this PR.Beside, I found the certificates in test are expired since 2018, and I can't found the key of ca in the project. So I have generate some new certificates which will expired after 1000 years, and make the test more clear.
Could you help me review this PR, so Thanks!