Skip to content

MGMT-22518: Adding RHOAI application endpoint to the list of known hosts for SNO#9936

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
pastequo:feat/add-rhoai-dns-to-etc-hosts
Mar 6, 2026
Merged

MGMT-22518: Adding RHOAI application endpoint to the list of known hosts for SNO#9936
openshift-merge-bot[bot] merged 1 commit intoopenshift:masterfrom
pastequo:feat/add-rhoai-dns-to-etc-hosts

Conversation

@pastequo
Copy link
Copy Markdown
Contributor

@pastequo pastequo commented Feb 25, 2026

If the target cluster is a SNO cluster & openshift-ai operator is selected, then we add the rhods dashboard url to the dnsmasq config

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Deployed a SNO cluster and check by ssh-ing to the node that there is dns resolution

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

Release Notes

  • New Features
    • Added conditional DNS configuration support for RHODS dashboard that automatically activates when the OpenShift AI operator is present and enabled in your cluster deployment.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Feb 25, 2026

@pastequo: This pull request references MGMT-22518 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

If the target cluster is a SNO cluster & openshift-ai operator is selected, then we add the rhods dashboard url to the dnsmasq config

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Deployed a SNO cluster and check by ssh-ing to the node that there is dns resolution

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 25, 2026

Walkthrough

Adds RHODS dashboard flag support to DNSMasq single-node manifest generation by checking the OpenShift AI operator status. The implementation conditionally includes RHODS dashboard DNS entries in the manifest template based on operator enablement state.

Changes

Cohort / File(s) Summary
RHODS Dashboard DNSMasq Support
internal/network/manifests_generator.go
Added operator-based check for RHODS_DASHBOARD_ENABLED in createDnsmasqForSingleNode. Computes rhodsEnabled status, passes it to manifest parameters, and extends DNSMasq template to conditionally insert RHODS dashboard DNS entry. Updated imports and log messaging.
RHODS DNSMasq Test Coverage
internal/network/manifests_generator_test.go
Added OpenShift AI operator import, extractDnsmasqScript helper function, and two test cases validating that RHODS dashboard DNS entry is conditionally included based on operator enablement state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning The two new RHODS test cases lack meaningful failure messages in their assertions at lines 537 and 552, violating custom check requirements for assertion diagnostics. Add descriptive messages to both Expect() assertions explaining what is being tested and why it matters for debugging assertion failures.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main change: adding RHOAI/RHODS dashboard endpoint to dnsmasq config for SNO clusters, which matches the primary modification in the changeset.
Description check ✅ Passed Description includes summary of change, environments impacted (Cloud), type (New Feature), testing approach (Manual with specific deployment details), and all required checklist items completed.
Stable And Deterministic Test Names ✅ Passed The two new test cases use stable and deterministic names without dynamic information. All dynamic values are properly placed in test bodies, not titles.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2026
@openshift-ci openshift-ci Bot requested review from carbonin and jhernand February 25, 2026 09:08
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Feb 25, 2026

@pastequo: This pull request references MGMT-22518 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

If the target cluster is a SNO cluster & openshift-ai operator is selected, then we add the rhods dashboard url to the dnsmasq config

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Deployed a SNO cluster and check by ssh-ing to the node that there is dns resolution

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

Release Notes

  • New Features
  • Added conditional DNS configuration support for RHODS dashboard that automatically activates when the OpenShift AI operator is present and enabled in your cluster deployment.

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
internal/network/manifests_generator.go (1)

114-114: Template conditional is correct; consider formatting it as a block for readability.
Keeping the conditional on separate lines reduces accidental template concatenation mistakes in future edits.

Optional readability tweak
-{{if .RHODS_DASHBOARD_ENABLED}}address=/rhods-dashboard-redhat-ods-applications.apps.${CLUSTER_FULL_DOMAIN}/${HOST_IP}{{end}}
+{{if .RHODS_DASHBOARD_ENABLED}}
+address=/rhods-dashboard-redhat-ods-applications.apps.${CLUSTER_FULL_DOMAIN}/${HOST_IP}
+{{end}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/network/manifests_generator.go` at line 114, The single-line
template conditional risks accidental concatenation; refactor the DNS entry into
a block by placing the opening tag {{if .RHODS_DASHBOARD_ENABLED}} on its own
line, the address=... line on the next line using ${CLUSTER_FULL_DOMAIN} and
${HOST_IP}, and the closing {{end}} on its own line so the conditional and its
content are clearly separated (references: .RHODS_DASHBOARD_ENABLED,
${CLUSTER_FULL_DOMAIN}, ${HOST_IP}).
internal/network/manifests_generator_test.go (1)

540-553: Consider one extra negative case with a non-AI operator present.
Current negative coverage uses nil; adding a “different operator exists” case would guard against accidental len(operators) > 0 regressions in future refactors.

Suggested test addition
+		It("does not include RHODS dashboard DNS when only non-AI operators are enabled", func() {
+			cluster := createCluster("", "3.3.3.0/24",
+				createInventory(createInterface("3.3.3.3/24")))
+			cluster.Hosts[0].Bootstrap = true
+			cluster.Cluster.BaseDNSDomain = "test.com"
+			cluster.Cluster.Name = "test"
+			cluster.MonitoredOperators = []*models.MonitoredOperator{
+				{Name: "local-storage-operator"},
+			}
+
+			created, err := createDnsmasqForSingleNode(logrus.New(), cluster)
+			Expect(err).To(Not(HaveOccurred()))
+
+			dnsmasqScript := extractDnsmasqScript(created)
+			Expect(dnsmasqScript).NotTo(ContainSubstring("rhods-dashboard-redhat-ods-applications"))
+		})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/network/manifests_generator_test.go` around lines 540 - 553, Add a
second negative test case to ensure presence of non-AI operators doesn't trigger
RHODS DNS—duplicate the existing It block ("does not include RHODS dashboard DNS
when OpenShift AI operator is not enabled") but set MonitoredOperators to a
slice containing a non-AI operator (e.g., an operator with a different Name)
instead of nil; call createDnsmasqForSingleNode and validate via
extractDnsmasqScript that the output still does not
ContainSubstring("rhods-dashboard-redhat-ods-applications"). This prevents
regressions where code checks only for len(MonitoredOperators) > 0 rather than
explicitly for the OpenShift AI operator.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/network/manifests_generator_test.go`:
- Around line 540-553: Add a second negative test case to ensure presence of
non-AI operators doesn't trigger RHODS DNS—duplicate the existing It block
("does not include RHODS dashboard DNS when OpenShift AI operator is not
enabled") but set MonitoredOperators to a slice containing a non-AI operator
(e.g., an operator with a different Name) instead of nil; call
createDnsmasqForSingleNode and validate via extractDnsmasqScript that the output
still does not ContainSubstring("rhods-dashboard-redhat-ods-applications"). This
prevents regressions where code checks only for len(MonitoredOperators) > 0
rather than explicitly for the OpenShift AI operator.

In `@internal/network/manifests_generator.go`:
- Line 114: The single-line template conditional risks accidental concatenation;
refactor the DNS entry into a block by placing the opening tag {{if
.RHODS_DASHBOARD_ENABLED}} on its own line, the address=... line on the next
line using ${CLUSTER_FULL_DOMAIN} and ${HOST_IP}, and the closing {{end}} on its
own line so the conditional and its content are clearly separated (references:
.RHODS_DASHBOARD_ENABLED, ${CLUSTER_FULL_DOMAIN}, ${HOST_IP}).

ℹ️ Review info

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f90427b and feaf8c6.

📒 Files selected for processing (2)
  • internal/network/manifests_generator.go
  • internal/network/manifests_generator_test.go

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 4, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gamli75, pastequo

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.10%. Comparing base (10cee3a) to head (feaf8c6).
⚠️ Report is 24 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9936      +/-   ##
==========================================
- Coverage   44.06%   43.10%   -0.97%     
==========================================
  Files         414      414              
  Lines       72172    73832    +1660     
==========================================
+ Hits        31803    31824      +21     
- Misses      37494    39131    +1637     
- Partials     2875     2877       +2     
Files with missing lines Coverage Δ
internal/network/manifests_generator.go 76.92% <100.00%> (+0.22%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pastequo
Copy link
Copy Markdown
Contributor Author

pastequo commented Mar 5, 2026

/retest

1 similar comment
@pastequo
Copy link
Copy Markdown
Contributor Author

pastequo commented Mar 6, 2026

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 6, 2026

@pastequo: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 0291a8a into openshift:master Mar 6, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants