-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ManagerOptions#CertDir default is confusing #900
Comments
Can I ask which OS you're using here? On most Linux distros, If we're gonna change this, we need to do it carefully, because it'd probably break a lot of folks. It's not really a problem on most linux installs, because At the very least, updating the comment seems reasonable, and wrapping the error message with a helpful
It should be -- a good general pattern for stuff that runs in containers is to choose a constant, reasonable default. Since you control the fs, you can just always mount there. The main problem here is that |
/kind bug |
/good-first-issue on the docs and improved error message |
@DirectXMan12: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
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. |
I was running the code locally on MacOS Catalina 10.15.4 (19E287). Good point on the reasonable default. What would be the new reasonable default in the current implementation? |
This would probably also be helpful:
|
controller-runtime/pkg/webhook/server.go Line 92 in 1c83ff6
It relies on os.TempDir to get the temp dir on different OS. IIRC CertDir is still an optional field, since if you don't need to run webhook at all, you don't need to set it. I'm more leaning toward updating the comment to point out default directory is determined by os.TempDir |
@mengqiy I think the main problem is that this might be autogenerated/ard to get at -- e.g. on OSX. That said, I don't think we can fix this easily w/o serious breakage, except maybe if we OS-detect OSX and special-case that for the moment. |
Not that we're getting around to integration testing with kind I am getting the same error in linux land with the default. @DirectXMan12 can you point me to the code that sets up the default certs at
|
How to overcome this? I think it would be good to have something work for the first-time implementation or maybe a bit more information in Readme will definitely help. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
If no one is assigned in this issue, can someone please assign this to me ? |
/assign |
/unassign |
Problem Description
The default for the
CertDir
configuration option is presently nonsensical. I expect because it is out of date with other changes in the expected workflow for a developer to configure TLS. A prior PR #300 removed the cert provisioners that would create local credentials at{TempDir}/k8s-webhook-server/serving-certs/tls.key
and{TempDir}/k8s-webhook-server/serving-certs/tls.crt
This default was likely missed in the refactor due to some unexpected tight coupling to the prior implementation. However, it creates some confusion for a new developer when trying to run the examples.CertDir has the comment
In the logs running the example you will get:
Developer Experience
A new developer is likely to run through the examples in the repository. This is what I was doing. The
CertDir
default sort of served as a red herring, masking the problem for awhile. The default value is so specific it seemed like something else was broken and the examples should work as written. However, in the current implementation it seems they require additional configuration.Possible Solution
Would love some feedback on the proper updates, but my inclination is to:
CertDir
nil
value forCertDir
mkcert
manager.New
to reflect that option is not optionalAdditional Context
Related Prior Contributions
@mengqiy authored PR #300 and it was reviewed by @droot and @DirectXMan12 and all of them may likely have superior context to the past, present, and future state. Would love to have y'alls input and thank you for your contributions ❤️
The text was updated successfully, but these errors were encountered: