Skip to content

DPF don't hard-code IP address in kubeconfig - #83183

Draft
omertuc wants to merge 1 commit into
openshift:mainfrom
omertuc:proxx
Draft

DPF don't hard-code IP address in kubeconfig#83183
omertuc wants to merge 1 commit into
openshift:mainfrom
omertuc:proxx

Conversation

@omertuc

@omertuc omertuc commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The existing kubeconfig step hard-codes the hypervisor IP address in the kubeconfig file, which is not ideal. This change introduces a new step that sets up cluster access by deploying a proxy on the hypervisor, which should handle DNS resolution and remove the need for hard-coded IP addresses in the kubeconfig.

The new step is called dpf-hypervisor-setup-cluster-access and replaces the previous dpf-hypervisor-load-kubeconfig step in the test configurations.

Most of the work is done by the make deploy-proxy command introduced in rh-ecosystem-edge/openshift-dpf#287

Summary by CodeRabbit

  • Replaces the DPF hypervisor kubeconfig test step with dpf-hypervisor-setup-cluster-access in OpenShift DPF conformance workflows.
  • Deploys a hypervisor proxy with make deploy-proxy, enables DNS resolution, and removes the hard-coded hypervisor IP from the kubeconfig.
  • Updates image registry setup to use the shared proxy configuration when available.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The change adds a DPF hypervisor cluster-access step. The step deploys a remote proxy, copies its kubeconfig, writes shared proxy configuration, and replaces the previous kubeconfig-loading step in two conformance workflows. Image-registry setup loads the shared configuration when present.

Changes

DPF cluster access

Layer / File(s) Summary
Register the cluster-access step
ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/*
The step registry defines the command, secret mount, default host, resources, timeout, documentation, metadata, and ownership.
Set up hypervisor proxy access
ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh
The script configures SSH, discovers the latest DPF installation, deploys the proxy, copies the kubeconfig, and writes proxy-conf.sh.
Integrate access into conformance workflows
ci-operator/config/rh-ecosystem-edge/openshift-dpf/*.yaml, ci-operator/step-registry/dpf/setup-image-registry/dpf-setup-image-registry-commands.sh
Both conformance workflows use dpf-hypervisor-setup-cluster-access. Image-registry setup conditionally sources the shared proxy configuration.

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

Sequence Diagram(s)

sequenceDiagram
  participant ConformanceWorkflow
  participant Hypervisor
  participant SharedDirectory
  participant ImageRegistrySetup
  ConformanceWorkflow->>Hypervisor: Run dpf-hypervisor-setup-cluster-access
  Hypervisor-->>ConformanceWorkflow: Provide proxy kubeconfig
  ConformanceWorkflow->>SharedDirectory: Store kubeconfig and proxy-conf.sh
  ImageRegistrySetup->>SharedDirectory: Load proxy-conf.sh when present
  ImageRegistrySetup->>ImageRegistrySetup: Configure the image registry
Loading

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The new step logs ${REMOTE_HOST} in lines 14 and 36; its configured default is the internal bastion address 10.6.135.45. Remove the host value from status messages, or redact it before logging. Use generic messages such as “SSH check passed” and “Proxy setup completed.”
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing the hard-coded hypervisor IP address from the kubeconfig.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 The PR changes only YAML, shell, JSON, and OWNERS files; searches found no Ginkgo test-title APIs or dynamic test titles.
Test Structure And Quality ✅ Passed PASS: The pull request changes only CI YAML, step metadata, and shell scripts; it adds or modifies no Ginkgo test code, It blocks, or test fixtures.
Microshift Test Compatibility ✅ Passed The diff adds only YAML, shell, metadata, and OWNERS files; it adds no Go/Ginkgo tests or It/Describe/Context/When declarations, so this check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch adds no Go or Ginkgo tests; it only changes CI YAML, step-registry metadata, and shell scripts, with no new It/Describe/Context/When markers.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only CI step/configuration scripts and metadata; it adds no deployment manifest, operator code, controller, or topology-sensitive scheduling constraint.
Ote Binary Stdout Contract ✅ Passed PR changes only CI YAML, OWNERS, and Bash step scripts; no Go/OTE binary, Ginkgo suite, or process-level Go stdout code is added or modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch changes CI steps and shell/YAML metadata only; it adds or modifies no Ginkgo e2e tests, so this check is not applicable.
No-Weak-Crypto ✅ Passed The exact PR patch contains no MD5, SHA1, DES, 3DES, RC4, Blowfish, ECB, custom crypto, or secret comparison; base64 only decodes an SSH key.
Container-Privileges ✅ Passed The new step and changed configs define no privileged:true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation:true; test capabilities are only intranet.
✨ 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 Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: omertuc
Once this PR has been reviewed and has the lgtm label, please assign szigmon 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-merge-bot openshift-merge-bot Bot added the rehearsals-ack Signifies that rehearsal jobs have been acknowledged label Aug 10, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@omertuc: no rehearsable tests are affected by this change

Note: If this PR includes changes to step registry files (ci-operator/step-registry/) and you expected jobs to be found, try rebasing your PR onto the base branch. This helps pj-rehearse accurately detect changes when the base branch has moved forward.
The following jobs are not rehearsable without the network-access-rehearsals-ok, and approved labels present on this PR. This is due to the restrict_network_access field being set to false. The network-access-rehearsals-ok label can be added by any openshift org member other than the PR's author by commenting: /pj-rehearse network-access-allowed:

Test name
pull-ci-rh-ecosystem-edge-openshift-dpf-release-4.22-conformance
pull-ci-rh-ecosystem-edge-openshift-dpf-main-conformance

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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
`@ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh`:
- Around line 19-21: Replace the source call following the scp of
last-openshift-dpf-dir.sh with safe parsing of only the expected
LAST_OPENSHIFT_DPF assignment. Validate the extracted value against the
permitted path format, then export LAST_OPENSHIFT_DPF for subsequent commands;
never execute or source any content from the hypervisor-fetched file.
- Around line 12-15: Update the SSH configuration in the setup-cluster-access
command flow to require host-key verification for the credentialed connection:
remove the insecure StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null
options, mount or reference the trusted host-key credential, and configure SSH
to use it with StrictHostKeyChecking=yes. Apply the same verified options to the
SSH connectivity test and subsequent SSH operations.
🪄 Autofix

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: c7baf5c1-0db1-41b5-95ff-eda607beb381

📥 Commits

Reviewing files that changed from the base of the PR and between b136251 and 8d91efa.

📒 Files selected for processing (7)
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-main.yaml
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-release-4.22.yaml
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/OWNERS
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.metadata.json
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.yaml
  • ci-operator/step-registry/dpf/setup-image-registry/dpf-setup-image-registry-commands.sh

Comment on lines +12 to +15
SSH_OPTS="-i /tmp/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -o ConnectTimeout=30 -o ServerAliveInterval=10 -o ServerAliveCountMax=3 -o BatchMode=yes"

echo "Testing SSH to ${REMOTE_HOST}..."
ssh ${SSH_OPTS} root@${REMOTE_HOST} echo 'SSH OK'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Require host-key verification for the credentialed SSH connection.

StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null accept any host while the step uses the mounted private key. A man-in-the-middle endpoint can alter the SSH session and the files copied from the hypervisor. Mount a trusted host key through the step credentials and use StrictHostKeyChecking=yes.

🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 15-15: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 15-15: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 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
`@ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh`
around lines 12 - 15, Update the SSH configuration in the setup-cluster-access
command flow to require host-key verification for the credentialed connection:
remove the insecure StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null
options, mount or reference the trusted host-key credential, and configure SSH
to use it with StrictHostKeyChecking=yes. Apply the same verified options to the
SSH connectivity test and subsequent SSH operations.

Comment on lines +19 to +21
scp ${SSH_OPTS} root@${REMOTE_HOST}:${REMOTE_LAST_OPENSHIFT_DPF_DIR_LOCATION} /tmp
set -a
source /tmp/last-openshift-dpf-dir.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not source shell code fetched from the hypervisor.

last-openshift-dpf-dir.sh is copied from the remote host and then executed in the CI container. A compromised hypervisor can run commands in the CI container and access the mounted private key or ${SHARED_DIR}. Parse and validate only the expected LAST_OPENSHIFT_DPF value instead of sourcing the file.

🧰 Tools
🪛 ast-grep (0.45.0)

[warning] 20-20: Writing to or reading from a hardcoded, predictable path under /tmp is vulnerable to symlink and TOCTOU attacks: a local attacker can pre-create the file (or a symlink pointing elsewhere) and hijack or corrupt the contents. Generate a unique, unpredictable temporary file with mktemp instead, e.g. tmpfile="$(mktemp)" (or mktemp -d for directories) and reference "$tmpfile".
Context: /tmp/last-openshift-dpf-dir.sh
Note: [CWE-377] Insecure Temporary File.

(predictable-tmp-file-bash)

🪛 Shellcheck (0.11.0)

[info] 19-19: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 19-19: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 19-19: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 21-21: Not following: /tmp/last-openshift-dpf-dir.sh was not specified as input (see shellcheck -x).

(SC1091)

🤖 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
`@ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh`
around lines 19 - 21, Replace the source call following the scp of
last-openshift-dpf-dir.sh with safe parsing of only the expected
LAST_OPENSHIFT_DPF assignment. Validate the extracted value against the
permitted path format, then export LAST_OPENSHIFT_DPF for subsequent commands;
never execute or source any content from the hypervisor-fetched file.

The existing kubeconfig step hard-codes the hypervisor IP address in the
kubeconfig file, which is not ideal. This change introduces a new step
that sets up cluster access by deploying a proxy on the hypervisor,
which should handle DNS resolution and remove the need for hard-coded IP
addresses in the kubeconfig.

The new step is called `dpf-hypervisor-setup-cluster-access` and
replaces the previous `dpf-hypervisor-load-kubeconfig` step in the test
configurations.

Most of the work is done by the make deploy-proxy command introduced in
rh-ecosystem-edge/openshift-dpf#287
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@omertuc: pj-rehearse could not automatically process this event because the request waited in queue for longer than 5 minutes. Use /pj-rehearse to trigger rehearsals manually.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh (2)

19-21: ⚠️ Potential issue | 🟠 Major

Do not source shell code fetched from the hypervisor.

last-openshift-dpf-dir.sh is copied from the remote host and then executed in the CI container. A compromised hypervisor can run commands in the CI container and access the mounted private key or ${SHARED_DIR}. Parse and validate only LAST_OPENSHIFT_DPF, then export it for the later ssh and scp commands.


12-15: ⚠️ Potential issue | 🟠 Major

Require host-key verification for the credentialed SSH connection.

StrictHostKeyChecking=no and UserKnownHostsFile=/dev/null still accept any server identity. This removes host authentication for every ssh and scp call that reuses SSH_OPTS. Configure a trusted known-hosts file and use StrictHostKeyChecking=yes.

🤖 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
`@ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh`
around lines 12 - 15, Update the SSH_OPTS definition used by the credentialed
SSH and scp calls to reference a trusted known-hosts file and set
StrictHostKeyChecking=yes; remove the insecure UserKnownHostsFile=/dev/null
setting while preserving the remaining connection options.
🤖 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.

Duplicate comments:
In
`@ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh`:
- Around line 12-15: Update the SSH_OPTS definition used by the credentialed SSH
and scp calls to reference a trusted known-hosts file and set
StrictHostKeyChecking=yes; remove the insecure UserKnownHostsFile=/dev/null
setting while preserving the remaining connection options.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 0d7de312-f3ed-472a-b64d-3672afa42631

📥 Commits

Reviewing files that changed from the base of the PR and between b136251 and ad7c274.

📒 Files selected for processing (7)
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-main.yaml
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-release-4.22.yaml
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/OWNERS
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-commands.sh
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.metadata.json
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.yaml
  • ci-operator/step-registry/dpf/setup-image-registry/dpf-setup-image-registry-commands.sh
🚧 Files skipped from review as they are similar to previous changes (5)
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.yaml
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/dpf-hypervisor-setup-cluster-access-ref.metadata.json
  • ci-operator/step-registry/dpf/hypervisor/setup-cluster-access/OWNERS
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-release-4.22.yaml
  • ci-operator/config/rh-ecosystem-edge/openshift-dpf/rh-ecosystem-edge-openshift-dpf-main.yaml

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. rehearsals-ack Signifies that rehearsal jobs have been acknowledged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant