fix(cert-manager): resolve reconciliation issues with enableCertificateOwnerRef#352
fix(cert-manager): resolve reconciliation issues with enableCertificateOwnerRef#352valen-mascarenhas14 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: valen-mascarenhas14 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 @valen-mascarenhas14. Thanks for your PR. I'm waiting for a etcd-io 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. |
Signed-off-by: Valen Mascarenhas <valen.mascarenhas@ibm.com>
335cf3d to
f6cada7
Compare
Fixes #331
PR Description
Problem
The operator cannot reconcile ETCD clusters when using cert-manager configured with
enableCertificateOwnerRef=true. This manifests in two ways:Certificate creation fails due to invalid duration parsing:
Owner reference conflicts when cert-manager's
enableCertificateOwnerRef=truesets Certificate as the controller owner of TLS secrets, preventing the operator from managing them.Root Causes
Duration Parsing Issue:
Go's
time.ParseDurationdoesn't support day units (d), but the sample configuration and API documentation use day-based durations like"365d"and"100d12h".Owner Reference Issue:
When
enableCertificateOwnerRef=true, cert-manager sets itself as the controller owner of TLS secrets. The operator was attempting to overwrite this ownership, causing reconciliation failures.Solution
1. Duration Parsing Fix:
Enhanced
parseValidityDurationto automatically convert day units to hours:"365d"→"8760h"(365 × 24 hours)"100d12h"→"2412h"(100 × 24 + 12 hours)2. Owner Reference Fix:
Modified secret ownership logic to: