Skip to content

OCPBUGS-88511: Pass live ingress domain into import-cluster-config - #10719

Open
PratikUplenchwar wants to merge 1 commit into
openshift:mainfrom
PratikUplenchwar:OCPBUGS-88511-node-joiner-ingress-domain
Open

OCPBUGS-88511: Pass live ingress domain into import-cluster-config#10719
PratikUplenchwar wants to merge 1 commit into
openshift:mainfrom
PratikUplenchwar:OCPBUGS-88511-node-joiner-ingress-domain

Conversation

@PratikUplenchwar

@PratikUplenchwar PratikUplenchwar commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • During node-joiner add-nodes cluster inspection, read ingress.config.openshift.io/cluster and capture spec.appsDomain (if set) or spec.domain.
  • Include that value as ingressDomain in import-cluster-config.json embedded in the node ISO.
  • Assisted-service (PR #10714) consumes this field as ingress_domain so Day-2 apps DNS validation uses the live ingress domain instead of always deriving apps.<name>.<baseDomain>.

This is the installer/node-joiner companion for OCPBUGS-88511.

Motivation

oc adm node-image create fails apps-domain-name-resolved-correctly when the cluster ingress domain was changed post-install, because Day-2 validation only had install-time cluster name + base domain.

Test plan

  • Unit tests: go test ./pkg/asset/agent/joiner/
  • ImportClusterConfig test covers copying IngressDomain
  • ClusterInfo fixtures include Ingress CR
  • CI / node-joiner integration tests
  • End-to-end with assisted-service PR DNM: Test updated GCP LB configs #10714: patch ingress domain, confirm ISO import-cluster-config.json contains it and apps validation uses the custom domain

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added support for detecting the cluster’s ingress domain.
    • Included the detected ingress domain in generated node-joining cluster configuration.
    • Added fallback handling when the application-specific domain is unavailable.
  • Bug Fixes

    • Improved processing of OpenShift Ingress resources during cluster configuration generation.

Read ingress.config.openshift.io/cluster during add-nodes inspection and
include the domain in import-cluster-config.json so assisted-service can
validate apps DNS against the live ingress domain instead of the
install-time apps.<name>.<baseDomain> default.

Assisted-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@PratikUplenchwar: This pull request references Jira Issue OCPBUGS-88511, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

  • During node-joiner add-nodes cluster inspection, read ingress.config.openshift.io/cluster and capture spec.appsDomain (if set) or spec.domain.
  • Include that value as ingressDomain in import-cluster-config.json embedded in the node ISO.
  • Assisted-service (PR #10714) consumes this field as ingress_domain so Day-2 apps DNS validation uses the live ingress domain instead of always deriving apps.<name>.<baseDomain>.

This is the installer/node-joiner companion for OCPBUGS-88511.

Motivation

oc adm node-image create fails apps-domain-name-resolved-correctly when the cluster ingress domain was changed post-install, because Day-2 validation only had install-time cluster name + base domain.

Test plan

  • Unit tests: go test ./pkg/asset/agent/joiner/
  • ImportClusterConfig test covers copying IngressDomain
  • ClusterInfo fixtures include Ingress CR
  • CI / node-joiner integration tests
  • End-to-end with assisted-service PR DNM: Test updated GCP LB configs #10714: patch ingress domain, confirm ISO import-cluster-config.json contains it and apps validation uses the custom domain

Made with Cursor

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

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Changes

Ingress domain propagation

Layer / File(s) Summary
Ingress resource test fixture
cmd/node-joiner/nodejoiner_integration_test.go, cmd/node-joiner/testdata/setup/...
Test setup registers and creates the OpenShift Ingress resource, while GVR resolution maps it to ingresses.
Cluster ingress retrieval
pkg/asset/agent/joiner/clusterinfo.go, pkg/asset/agent/joiner/clusterinfo_test.go
ClusterInfo.Generate retrieves spec.appsDomain, falling back to spec.domain, and stores it in IngressDomain.
Import configuration propagation
pkg/asset/agent/joiner/importclusterconfig.go, pkg/asset/agent/joiner/*test.go, cmd/node-joiner/testdata/add-nodes.txt
Generated import configuration now serializes and validates the propagated ingressDomain value.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (14 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Added test titles are static and deterministic; no dynamic names, timestamps, UUIDs, or generated identifiers were introduced.
Test Structure And Quality ✅ Passed PASS: The changed tests are plain table-driven/unit tests, not Ginkgo specs; they add focused cases and follow existing envtest cleanup/patterns.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only updates unit/envtest code and fixtures, so MicroShift gating is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; changes are unit/envtest coverage and testdata only, with no multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The patch only adds ingress-domain plumbing and test fixtures; no node selectors, affinities, PDBs, or replica/scheduling logic were introduced.
Ote Binary Stdout Contract ✅ Passed No process-level stdout writes found; main/TestMain route logs to stderr or discard, and the touched code has no fmt.Print/println in setup paths.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; changes are unit/integration test helpers and testdata only, with no Ginkgo or external-connectivity assumptions.
No-Weak-Crypto ✅ Passed PASS: Touched files only add ingress-domain plumbing; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or ConstantTimeCompare usage was found.
Container-Privileges ✅ Passed Changed YAML are only an Ingress CRD and Ingress resource; no privileged:true, hostPID/network/IPC, allowPrivilegeEscalation, or SYS_ADMIN appear in changed files.
No-Sensitive-Data-In-Logs ✅ Passed No new logging was added; the patch only reads and stores ingress domain in assets/tests, without emitting it or other sensitive data.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: passing the live ingress domain into import-cluster-config.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tthvo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci
openshift-ci Bot requested review from bfournie and rwsu July 28, 2026 09:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/asset/agent/joiner/clusterinfo_test.go (1)

480-486: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover appsDomain precedence, not only fallback.

The fixture currently sets only Spec.Domain, so the new Spec.AppsDomain branch is untested. Set both fields to different values and assert that IngressDomain equals AppsDomain.

As per path instructions, test files should cover edge cases, especially validation and defaulting logic.

Also applies to: 550-551

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/asset/agent/joiner/clusterinfo_test.go` around lines 480 - 486, The
cluster info fixture in the relevant test cases currently exercises only
Spec.Domain fallback. Set both Spec.Domain and Spec.AppsDomain to distinct
values, then update the IngressDomain assertions to verify AppsDomain takes
precedence; apply the same coverage to the tests around the additional
referenced lines.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/agent/joiner/clusterinfo.go`:
- Around line 220-223: Update ClusterInfo.retrieveIngressDomain to accept the
caller’s context, thread that context through its callback invocation, and pass
it to Ingresses().Get instead of context.Background(). Preserve the existing
ingress lookup and error propagation behavior.

---

Nitpick comments:
In `@pkg/asset/agent/joiner/clusterinfo_test.go`:
- Around line 480-486: The cluster info fixture in the relevant test cases
currently exercises only Spec.Domain fallback. Set both Spec.Domain and
Spec.AppsDomain to distinct values, then update the IngressDomain assertions to
verify AppsDomain takes precedence; apply the same coverage to the tests around
the additional referenced lines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: cb625c3b-c283-4d09-97c0-18ab0555e461

📥 Commits

Reviewing files that changed from the base of the PR and between 1768562 and ead4c47.

📒 Files selected for processing (8)
  • cmd/node-joiner/nodejoiner_integration_test.go
  • cmd/node-joiner/testdata/add-nodes.txt
  • cmd/node-joiner/testdata/setup/crds/0000_ingresses_crd.yaml
  • cmd/node-joiner/testdata/setup/default/0010_ingress.yaml
  • pkg/asset/agent/joiner/clusterinfo.go
  • pkg/asset/agent/joiner/clusterinfo_test.go
  • pkg/asset/agent/joiner/importclusterconfig.go
  • pkg/asset/agent/joiner/importclusterconfig_test.go

Comment on lines +220 to +223
func (ci *ClusterInfo) retrieveIngressDomain() error {
ingress, err := ci.OpenshiftClient.ConfigV1().Ingresses().Get(context.Background(), "cluster", metav1.GetOptions{})
if err != nil {
return err

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the relevant file and inspect the surrounding methods.
grep -n "retrieveIngressDomain\|Generate(\|ctx" -n pkg/asset/agent/joiner/clusterinfo.go || true
nl -ba pkg/asset/agent/joiner/clusterinfo.go | sed -n '100,260p'

Repository: openshift/installer

Length of output: 766


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the relevant section with line numbers using tools available in the sandbox.
sed -n '90,155p' pkg/asset/agent/joiner/clusterinfo.go | cat -n
printf '\n---\n'
sed -n '210,235p' pkg/asset/agent/joiner/clusterinfo.go | cat -n
printf '\n---\n'
# Show the callback type used by Generate if it comes from a helper in the same package.
grep -Rni "func (.*retrieveIngressDomain" pkg/asset/agent/joiner || true
grep -Rni "retrieveIngressDomain," pkg/asset/agent/joiner || true

Repository: openshift/installer

Length of output: 3483


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect any helper that accepts the functions passed from Generate.
grep -Rni "func .*inspect\|func .*run\|func .*generate" pkg/asset/agent/joiner | head -n 40

Repository: openshift/installer

Length of output: 908


Pass the caller’s context into the ingress lookup. retrieveIngressDomain uses context.Background(), so add-nodes cancellation and deadlines won’t stop a hung API request. Thread ctx through the callback and use it in Ingresses().Get(...).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/asset/agent/joiner/clusterinfo.go` around lines 220 - 223, Update
ClusterInfo.retrieveIngressDomain to accept the caller’s context, thread that
context through its callback invocation, and pass it to Ingresses().Get instead
of context.Background(). Preserve the existing ingress lookup and error
propagation behavior.

Source: Path instructions

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@PratikUplenchwar: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-tests-nodejoiner ead4c47 link true /test integration-tests-nodejoiner
ci/prow/golint ead4c47 link true /test golint

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants