π Render dnsServersFromPool into Metal3Data metadata #3900
Hi @amalsaidov. Thanks for your PR.
I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.
Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
<details>
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-sigs/prow repository.
</details>
/ok-to-test
/copilot-review
Copilot code review has been requested by @tuminoid. Please allow a few moments for the review to be added.
<!-- ccr-overview-v2 -->
π’ Approval recommended
No active review issues are recorded for the DNS metadata rendering change.
No open issues π
<details>
<summary><strong>What changed in this PR</strong></summary>
Addresses #3363 by rendering pool-provided DNS servers into Metal3Data metadata, making configured keys available to templates such as {{ ds.meta_data.dns }}.
Changes:
DNSServersFromPool values as strings, joining multiple DNS addresses with commas.| File | Description |
| ---- | ----------- |
| docs/βapi.md | Documents comma-separated rendering of multiple DNS servers. |
| baremetal/βmetal3data_manager.go | Adds DNS server rendering to renderMetaData, with an error for missing pools. |
| baremetal/βmetal3data_manager_test.go | Adds DNS metadata rendering and missing-pool test cases. |
</details>
<sub>Review effort: Balanced</sub>
/test metal3-centos-e2e-integration-test-main
/test metal3-ubuntu-e2e-integration-test-main
/lgtm
Thanks for the contribution!
/cc @lentzi90
cc @nuhakala
This PR addresses https://github.com/metal3-io/cluster-api-provider-metal3/issues/3363. It fixes a bug, so I think we can merge it during the freeze.
/approve
/cc @adilGhaffarDev
I have no approve here, PTAL.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/3900#pullrequestreview-6119082618" title="Approved">adilGhaffarDev</a>, <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/3900#pullrequestreview-6118757180" title="Approved">Rozzii</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
adilGhaffarDev
amalsaidov
What this PR does / why we need it:
metaData.dnsServersFromPoolentries of aMetal3DataTemplateare accepted by the API and their IP pools are already claimed bygetReferencedPools, butrenderMetaDatanever wrote the resolved DNS servers into the generated metadata. Because of this, a key configured throughdnsServersFromPoolwas missing from the-metadatasecret and a template reference such as{{ ds.meta_data.dns }}resolved to a missing value, even though the sibling fieldsgatewaysFromPool,ipAddressesFromPoolandprefixesFromPoolworked as expected.This renders the DNS servers from the resolved pool address. A pool can provide more than one DNS server, so they are joined into a single comma separated string; with a single server this is just the address, which matches the reproduction in the issue.
Changes:
baremetal/metal3data_manager.go: renderDNSServersFromPoolinrenderMetaData.baremetal/metal3data_manager_test.go: addrenderMetaDatacases for the single server, multiple server and missing pool scenarios.docs/api.md: document the rendering, including the comma separated form for multiple servers.Fixes #3363
Checklist: