← Back to Pull requests

πŸ› Render dnsServersFromPool into Metal3Data metadata #3900

Merged
amalsaidov merged 3 files (86 lines) on Nov 30, 2026 19:34 UTC
View on GitHub
amalsaidov amalsaidov commented on Nov 17, 2026 21:49 UTC
Author

What this PR does / why we need it:

metaData.dnsServersFromPool entries of a Metal3DataTemplate are accepted by the API and their IP pools are already claimed by getReferencedPools, but renderMetaData never wrote the resolved DNS servers into the generated metadata. Because of this, a key configured through dnsServersFromPool was missing from the -metadata secret and a template reference such as {{ ds.meta_data.dns }} resolved to a missing value, even though the sibling fields gatewaysFromPool, ipAddressesFromPool and prefixesFromPool worked 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: render DNSServersFromPool in renderMetaData.

  • baremetal/metal3data_manager_test.go: add renderMetaData cases 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:

  • Documentation has been updated, if necessary.

  • Unit tests have been added, if necessary.

  • E2E tests have been added, if necessary.

  • Integration tests have been added, if necessary.
  • Diff: 86 lines (+85 / -1) across 3 files Reviewer: adilGhaffarDev Review duration: 18585m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.33) Γ— (1 βˆ’ Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 Β· Change Risk (XGBoost)
    Score: 0.33 Β· 86 lines diff across 3 files
    0.33
    Model 2 Β· Review Depth (DistilBERT)
    Depth Score: 0.86 Β· 5 substantive comment(s)
    0.86
    Model 3 Β· Review Timing & Attention
    Session adequacy: 100% Β· Reviewer familiarity: 50%
    88%
    Bedrock Claude 3 Β· Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 Β· Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.267
    Real PR Conversation Timeline
    14 items
    metal3-io-bot metal3-io-bot commented on Nov 17, 2026 21:49 UTC
    Bot

    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>

    tuminoid tuminoid commented on Nov 25, 2026 16:36 UTC
    Reviewer

    /ok-to-test

    tuminoid tuminoid commented on Nov 25, 2026 16:36 UTC
    Contributor

    /copilot-review

    metal3-io-bot metal3-io-bot commented on Nov 25, 2026 16:36 UTC
    Bot

    Copilot code review has been requested by @tuminoid. Please allow a few moments for the review to be added.

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 25, 2026 16:44 UTC
    Reviewer

    <!-- 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:

  • Render DNSServersFromPool values as strings, joining multiple DNS addresses with commas.

  • Add unit test cases for single-server, multiple-server, and missing-pool scenarios.

  • Document the metadata rendering format.
  • | 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>

    tuminoid tuminoid commented on Nov 26, 2026 07:15 UTC
    Contributor

    /test metal3-centos-e2e-integration-test-main
    /test metal3-ubuntu-e2e-integration-test-main

    tuminoid tuminoid commented on Nov 26, 2026 08:07 UTC
    Reviewer

    /lgtm

    Thanks for the contribution!

    /cc @lentzi90

    Rozzii Rozzii commented on Nov 30, 2026 19:09 UTC
    Contributor

    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.

    Rozzii Rozzii commented on Nov 30, 2026 19:11 UTC
    Reviewer

    /approve

    Rozzii Rozzii commented on Nov 30, 2026 19:12 UTC
    Contributor

    /cc @adilGhaffarDev
    I have no approve here, PTAL.

    adilGhaffarDev adilGhaffarDev commented on Nov 30, 2026 19:29 UTC
    Reviewer

    /lgtm

    adilGhaffarDev adilGhaffarDev approved these changes on Nov 30, 2026 19:29 UTC
    Approved Reviewer

    /approve

    metal3-io-bot metal3-io-bot commented on Nov 30, 2026 19:29 UTC
    Bot

    [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:

  • ~~OWNERS~~ [adilGhaffarDev]
  • 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":[]} -->

    Assignees
    amalsaidov amalsaidov
    Labels
    risk: low confidence: 88.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk Β· Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 32.6% (LOW) Β· Higher = larger blast radius
    32.6%
    Review Confidence
    Review Confidence Β· Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.7% Β· Lower = rushed or shallow review
    88.7%
    Residual Risk
    Residual Risk Β· Core Equation
    Residual = Change Γ— (1 βˆ’ Confidence)
    Unmitigated risk surviving review. β‰₯ 0.65 triggers an automated re-queue to protect production.
    Score: 3.7% Β· Safe to merge
    3.7%