fix: propagate user-supplied altNames.ipAddresses to certificates#393
fix: propagate user-supplied altNames.ipAddresses to certificates#393xrl wants to merge 2 commits into
Conversation
createCMCertificateConfig and createAutoCertificateConfig filled AltNames.IPs with nil placeholders sized by the DNS-name count and never read the user-supplied field, so spec.tls.*.providerCfg.*.altNames.ipAddresses was silently dropped from issued certificates. The cert-manager provider also stringified IPs via fmt.Sprint (rendering nil entries as literal "<nil>"), and the auto provider never passed IPs to transport.SelfCert at all. Pass the user-supplied IPs through on both the custom and default DNS-name config paths, reject nil/empty IP entries with an explicit error, build Certificate.Spec.IPAddresses from ip.String() in the cert-manager provider, and append the IPs to the transport.SelfCert hosts list in the auto provider so they land in the issued certificate's IP SANs. Tests assert the emitted Certificate spec (cert-manager) and the parsed x509 IP SANs (auto). Signed-off-by: Xavier Lange <xrlange@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: xrl 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 @xrl. 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: Xavier Lange <xrlange@gmail.com>
|
Pushed 0f5b174 to fix the golangci-lint prealloc failure: the ipStrings slice in the cert-manager provider is now preallocated with capacity len(cfg.AltNames.IPs). |
Setting spec.tls..providerCfg..altNames.ipAddresses had no effect: the controller filled AltNames.IPs with nil placeholders and never read the user-supplied field, so issued certificates carried no IP SANs on either provider. The controller now passes user IPs through on both the custom and default DNS-name paths (rejecting nil/empty entries with an explicit error), the cert-manager provider builds Certificate.Spec.IPAddresses from ip.String() instead of fmt.Sprint, and the auto provider appends the IPs to the transport.SelfCert hosts list so they land in the issued certificate's IP SANs. Verified with go build ./... and go test ./internal/... ./api/... ./pkg/...; new tests assert the emitted Certificate spec (cert-manager) and the parsed x509 IP SANs (auto), and were confirmed to fail against the pre-fix code.
PR series — operability fixes & TLS
Small single-purpose PRs from live kind-cluster testing of the operator. Each stands alone unless an After is listed. → = this PR.
events.k8s.ioRBAC so operator Events are actually recordedmembers[]/leaderIDfrom one health snapshot (consistent leader)altNames.ipAddressesinto certificatesvalidityDuration(365d,100d12h) as documentedDegradedcondition (was empty status)--max-concurrent-reconciles)spec.tls.{peer,client}surfaces (breaking alpha API)TLSReadycondition + TLS lifecycle EventsPeerCANotShared/metricsendpointEtcdBackupCR → object storage (S3/GCS)🟢 ready · ⚪ draft