fix: allow disabling PKCS12 without password#642
Conversation
Signed-off-by: immanuwell <pchpr.00@list.ru>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @immanuwell. Thanks for your PR. I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
| // validation error will be picked up by validation. | ||
| func setDefaultKeyStorePKCS12(attr map[string]string) { | ||
| if _, ok := attr[csiapi.KeyStorePKCS12EnableKey]; ok { | ||
| if attr[csiapi.KeyStorePKCS12EnableKey] == "true" { |
There was a problem hiding this comment.
suggestion: this is a sharp edge if anyone set the value to "TRUE" or similar. Could we lowercase the attribute?
| if attr[csiapi.KeyStorePKCS12EnableKey] == "true" { | |
| if strings.ToLower(attr[csiapi.KeyStorePKCS12EnableKey]) == "true" { |
|
/ok-to-test |
What
Tiny PKCS12 papercut fix.
When
csi.cert-manager.io/pkcs12-enable: "false"is set, the driver should treat PKCS12 as disabled. Before this, defaulting still addedpkcs12-filename, and validation then asked forpkcs12-password. thats a bit awkward ngl.Repro
Use volume attributes like:
Before this change
WriteKeypairfails with:The new test covers that case. It also keeps the existing enabled path intact.
Test
go test -count=1 ./cmd/... ./pkg/...