Skip to content

Add target spoke deploy for ibu lane#80770

Open
shaior wants to merge 1 commit into
openshift:mainfrom
shaior:deploy-spoke-target
Open

Add target spoke deploy for ibu lane#80770
shaior wants to merge 1 commit into
openshift:mainfrom
shaior:deploy-spoke-target

Conversation

@shaior

@shaior shaior commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

This PR adds support for target spoke cluster deployment to the IBU (Image-Based Upgrade) lane testing infrastructure for CNF RAN (Cloud Native Function RAN).

Key Changes:

  1. New CI Step Registration: Introduces a new workflow step telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno that deploys a target SNO (Single Node OpenShift) spoke cluster via ZTP (Zero Touch Provisioning) on the IBU target hub. The step includes comprehensive environment variable configuration for target spoke version, cluster naming, and Git repository references.

  2. Workflow Integration: Updates the main IBU CNF RAN workflow to wire in the new target spoke deployment step, which executes after the target hub mirror/preparation phase and uses inventory files preserved from the target hub deployment step.

  3. Target Hub Setup: Modifies the target hub deployment step to preserve inventory files with a target- prefix in shared storage, ensuring they're available for downstream steps including the new spoke deployment.

  4. Mirror Configuration Update: Updates the target mirror/OCP preparation step to dynamically derive the kubeconfig path from the cluster name and pass it to the Ansible playbook.

  5. Config Updates: Modifies the eco-ci-cd configuration to properly format the SPOKE_CLUSTER and TARGET_SPOKE_CLUSTER variables as list representations.

The changes enable the IBU testing lane to deploy and validate a complete target hub and spoke topology for image-based upgrade scenarios, extending the existing seed hub-spoke testing infrastructure.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

A new CI step (telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno) is added to deploy a target SNO spoke cluster via ZTP on the IBU target hub. The ibu-target-hub-deploy script is updated to copy inventory files with a target- prefix into SHARED_DIR so they survive the subsequent seed-inventory restore. The ibu-target-mirror-ocp script switches to a new Ansible playbook and passes kubeconfig. Cluster variable values in the pipeline config are changed to list-formatted strings.

Changes

IBU Target SNO Spoke Deployment

Layer / File(s) Summary
Target hub inventory preservation and workflow wiring
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-hub-deploy/telcov10n-functional-cnf-ran-ibu-target-hub-deploy-commands.sh, ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu/telcov10n-functional-cnf-ran-ibu-workflow.yaml
The hub-deploy script copies inventory files to target-<key> counterparts in SHARED_DIR. The workflow YAML adds documentation, wires in the new step reference, and updates the pre-step description to include target hub SNO spoke deployment.
New ibu-target-deploy-spoke-sno step
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/OWNERS, ...ref.metadata.json, ...ref.yaml, ...commands.sh
Adds the complete new step: approver ownership, metadata JSON, step ref YAML with env vars and 5-hour timeout, and the commands script that reads target-* inventory from SHARED_DIR, builds Ansible group/host vars, and runs deploy-spoke-sno.yaml with kubeconfig and ZTP extra-vars.
Mirror OCP kubeconfig update and cluster variable list format
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-mirror-ocp/telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-commands.sh, ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibu-4.20.yaml
The mirror-OCP script switches from mirror-ocp-release.yml to prepare-ocp-release.yml and adds kubeconfig to extra-vars. SPOKE_CLUSTER and TARGET_SPOKE_CLUSTER in the pipeline config are changed to single-element list-formatted strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • kononovn
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add target spoke deploy for ibu lane' directly and clearly describes the main change: adding deployment functionality for a target spoke cluster in the IBU (In-Band Update) testing lane.
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 No Ginkgo test files are present in this PR. Changes are limited to CI/CD configuration, shell scripts, JSON metadata, and OWNERS files—check is not applicable.
Test Structure And Quality ✅ Passed PR contains CI/CD configuration changes (YAML, shell scripts, JSON metadata) with no Ginkgo test code. The custom check for test structure quality is not applicable.
Microshift Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. All changes are CI/CD infrastructure files (YAML configs, shell scripts, JSON metadata, OWNERS). The check for MicroShift test compatibility is not applica...
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR contains no Ginkgo e2e tests. It only modifies CI/CD infrastructure files (YAML configs, bash scripts, JSON metadata) in the ci-operator directory. The check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR introduces only CI/CD infrastructure (config files, step registry definitions, shell scripts, workflows) with no deployment manifests, operator code, or scheduling constraints that could affect...
Ote Binary Stdout Contract ✅ Passed This PR contains only CI/CD shell scripts and configuration files, not Go test code or OTE binaries. The OTE stdout contract check is not applicable to CI operator step scripts.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are present in this PR. The custom check targets new test code; this PR only adds CI infrastructure (YAML config, bash scripts, JSON metadata).
No-Weak-Crypto ✅ Passed No weak cryptographic algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret comparisons detected in PR changes.
Container-Privileges ✅ Passed No Kubernetes container manifests with privilege settings found. PR contains only OpenShift CI operator configs, shell scripts, and metadata—no Pod/Deployment specs.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data logging found. SSH keys handled securely without being echoed, no passwords/tokens/API keys logged, only non-sensitive cluster names, versions, and file paths logged.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci

openshift-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shaior

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2026
@shaior

shaior commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-kni-eco-ci-cd-main-cnf-ran-ibu-4.20-cnf-ran-ztp-tests

@openshift-ci openshift-ci Bot requested review from cplacani and dgoodwin June 18, 2026 23:44
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@shaior: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@shaior: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-openshift-kni-eco-ci-cd-main-cnf-ran-ibu-4.20-cnf-ran-ztp-tests N/A periodic Ci-operator config changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@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: 3

🧹 Nitpick comments (1)
ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh (1)

17-21: ⚡ Quick win

Quote variable expansions in cp paths.

These lines are currently vulnerable to word-splitting/globbing edge cases (ShellCheck SC2086).

Suggested patch
-cp ${SHARED_DIR}/target-all ${INVENTORY_PATH}/group_vars/all
-cp ${SHARED_DIR}/target-bastions ${INVENTORY_PATH}/group_vars/bastions
-cp ${SHARED_DIR}/target-hypervisors ${INVENTORY_PATH}/group_vars/hypervisors
-cp ${SHARED_DIR}/target-nodes ${INVENTORY_PATH}/group_vars/nodes
-cp ${SHARED_DIR}/target-masters ${INVENTORY_PATH}/group_vars/masters
+cp "${SHARED_DIR}/target-all" "${INVENTORY_PATH}/group_vars/all"
+cp "${SHARED_DIR}/target-bastions" "${INVENTORY_PATH}/group_vars/bastions"
+cp "${SHARED_DIR}/target-hypervisors" "${INVENTORY_PATH}/group_vars/hypervisors"
+cp "${SHARED_DIR}/target-nodes" "${INVENTORY_PATH}/group_vars/nodes"
+cp "${SHARED_DIR}/target-masters" "${INVENTORY_PATH}/group_vars/masters"
@@
-cp ${SHARED_DIR}/target-bastion ${INVENTORY_PATH}/host_vars/bastion
-cp ${SHARED_DIR}/target-hypervisor ${INVENTORY_PATH}/host_vars/hypervisor
-cp ${SHARED_DIR}/target-master0 ${INVENTORY_PATH}/host_vars/master0
+cp "${SHARED_DIR}/target-bastion" "${INVENTORY_PATH}/host_vars/bastion"
+cp "${SHARED_DIR}/target-hypervisor" "${INVENTORY_PATH}/host_vars/hypervisor"
+cp "${SHARED_DIR}/target-master0" "${INVENTORY_PATH}/host_vars/master0"

Also applies to: 27-29

🤖 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/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh`
around lines 17 - 21, The cp command paths are vulnerable to word-splitting and
globbing issues because variable expansions are not quoted. Fix this by wrapping
all variable expansions in double quotes in the cp commands on lines 17-21 and
also on lines 27-29. Specifically, wrap ${SHARED_DIR} and ${INVENTORY_PATH}
variables in double quotes so that each path is treated as a single argument to
the cp command, preventing unintended word-splitting or globbing expansion.

Source: Linters/SAST tools

🤖 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/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibu-4.20.yaml`:
- Line 36: The SPOKE_CLUSTER and TARGET_SPOKE_CLUSTER environment variables use
Python-style list syntax with escaped quotes that produces invalid JSON when
parsed by the shell. Replace the current Python-style syntax (with doubled
single quotes for escaping) with proper JSON array syntax using double quotes
inside single quotes. Change the format from '[''value'']' to '["value"]' so
that after shell parsing strips the outer quotes, a valid JSON array remains for
Ansible consumption.

In
`@ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh`:
- Around line 2-3: The shell script is missing the -u flag in its error handling
setup. Replace the two separate set commands (set -e and set -o pipefail) with a
single combined command that includes the -u flag (set -euo pipefail) at the
beginning of the script to ensure unset environment variables are caught and
cause the script to exit with a clear error rather than silently expanding to
empty strings.

In
`@ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-mirror-ocp/telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-commands.sh`:
- Around line 20-25: The CLUSTER_NAME variable is only conditionally assigned
when the file at ${SHARED_DIR}/cluster_name exists, but it is then used
unconditionally in the KUBECONFIG_PATH construction. If the file does not exist
and CLUSTER_NAME is not pre-set, the path will be malformed. Add validation
after the conditional block to check that CLUSTER_NAME is not empty, and either
exit with an error message or set a default value if appropriate for your use
case. This ensures KUBECONFIG_PATH always has a valid cluster name.

---

Nitpick comments:
In
`@ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh`:
- Around line 17-21: The cp command paths are vulnerable to word-splitting and
globbing issues because variable expansions are not quoted. Fix this by wrapping
all variable expansions in double quotes in the cp commands on lines 17-21 and
also on lines 27-29. Specifically, wrap ${SHARED_DIR} and ${INVENTORY_PATH}
variables in double quotes so that each path is treated as a single argument to
the cp command, preventing unintended word-splitting or globbing expansion.
🪄 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: 90648372-5e18-48b2-a448-f38291860164

📥 Commits

Reviewing files that changed from the base of the PR and between 879dbb8 and 7ecf756.

📒 Files selected for processing (8)
  • ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibu-4.20.yaml
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/OWNERS
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-ref.metadata.json
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-ref.yaml
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-hub-deploy/telcov10n-functional-cnf-ran-ibu-target-hub-deploy-commands.sh
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-mirror-ocp/telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-commands.sh
  • ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu/telcov10n-functional-cnf-ran-ibu-workflow.yaml

{"name":"topology-aware-lifecycle-manager","catalog":"topology-aware-lifecycle-manager-fbc","og_name":"global-operators","nsname":"openshift-operators","fbc_iib_repo":"latest","channel":"stable","deploy_default_config":false,"ocp_operator_mirror_fbc_image_base":"quay.io/redhat-user-workloads/telco-5g-tenant/topology-aware-lifecycle-manager-fbc-${VERSION_TAG}"}
]
SPOKE_CLUSTER: ibu-seed
SPOKE_CLUSTER: '[''ibu-seed'']'

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Show where these vars are injected into ansible extra-vars.
rg -n "spoke_clusters='\\$\\{(SPOKE_CLUSTER|TARGET_SPOKE_CLUSTER)\\}'" ci-operator/step-registry/telcov10n/functional/cnf-ran

# Quick parser sanity check for problematic quoting shape.
python - <<'PY'
import shlex
cases = [
    "spoke_clusters='['ibu-seed']'",
    "spoke_clusters='[\"ibu-seed\"]'",
]
for c in cases:
    print(f"\nCASE: {c}")
    try:
        print("shlex:", shlex.split(c))
    except Exception as e:
        print("ERROR:", e)
PY

Repository: openshift/release

Length of output: 594


🏁 Script executed:

cat -n ci-operator/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibu-4.20.yaml | head -60

Repository: openshift/release

Length of output: 6643


🏁 Script executed:

cat -n ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh

Repository: openshift/release

Length of output: 2188


🏁 Script executed:

cat -n ci-operator/step-registry/telcov10n/functional/cnf-ran/deploy-spoke-sno/telcov10n-functional-cnf-ran-deploy-spoke-sno-commands.sh

Repository: openshift/release

Length of output: 1935


🏁 Script executed:

find ci-operator/step-registry/telcov10n -name "deploy-spoke-sno.yaml" -o -name "*.yaml" | xargs rg -l "deploy-spoke-sno" | head -5

Repository: openshift/release

Length of output: 594


🏁 Script executed:

# Find the Ansible playbook
fd -t f "deploy-spoke-sno.yaml" /eco-ci-cd 2>/dev/null || echo "Playbook not in repo; searching step-registry references"
rg -A 5 "def spoke_clusters" ci-operator/step-registry/

Repository: openshift/release

Length of output: 118


🏁 Script executed:

# Check if there's any documentation on how these vars should be formatted
rg -B 3 -A 3 "spoke_clusters" ci-operator/step-registry/telcov10n/functional/cnf-ran/ --type sh --type yaml

Repository: openshift/release

Length of output: 2805


🏁 Script executed:

# Verify actual impact: test both formats with Python's JSON parser
python3 <<'PY'
import json

# Test what Ansible would see after shell parsing
test_cases = [
    ("[ibu-seed]", "Python-style after shell parsing (quotes lost)"),
    ('["ibu-seed"]', "JSON-style after shell parsing (quotes preserved)"),
]

for val, desc in test_cases:
    print(f"\n{desc}")
    print(f"  Value: {val}")
    try:
        parsed = json.loads(val)
        print(f"  JSON parse OK: {parsed} (type: {type(parsed).__name__})")
    except json.JSONDecodeError as e:
        print(f"  JSON parse FAILED: {e}")
PY

Repository: openshift/release

Length of output: 308


Use JSON array syntax for SPOKE_CLUSTER and TARGET_SPOKE_CLUSTER environment variables.

The current Python-style list syntax with escaped quotes ('[''ibu-seed'']') produces invalid JSON when passed to Ansible. After shell parsing, the outer quotes are stripped, leaving [ibu-seed], which fails JSON validation. Ansible expects valid JSON arrays for these variables; use '["ibu-seed"]' instead, which correctly produces ["ibu-seed"] after shell parsing.

Suggested patch
-      SPOKE_CLUSTER: '[''ibu-seed'']'
+      SPOKE_CLUSTER: '["ibu-seed"]'
@@
-      TARGET_SPOKE_CLUSTER: '[''ibu-target'']'
+      TARGET_SPOKE_CLUSTER: '["ibu-target"]'
🤖 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/config/openshift-kni/eco-ci-cd/openshift-kni-eco-ci-cd-main__cnf-ran-ibu-4.20.yaml`
at line 36, The SPOKE_CLUSTER and TARGET_SPOKE_CLUSTER environment variables use
Python-style list syntax with escaped quotes that produces invalid JSON when
parsed by the shell. Replace the current Python-style syntax (with doubled
single quotes for escaping) with proper JSON array syntax using double quotes
inside single quotes. Change the format from '[''value'']' to '["value"]' so
that after shell parsing strips the outer quotes, a valid JSON array remains for
Ansible consumption.

Comment on lines +2 to +3
set -e
set -o pipefail

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.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Use set -euo pipefail in this step script.

set -u is missing, so unset env vars can silently expand to empty strings and fail later with less actionable errors.

Suggested patch
-set -e
-set -o pipefail
+set -euo pipefail

As per coding guidelines, step registry command scripts should use the default set -euo pipefail (without -x).

🤖 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/telcov10n/functional/cnf-ran/ibu-target-deploy-spoke-sno/telcov10n-functional-cnf-ran-ibu-target-deploy-spoke-sno-commands.sh`
around lines 2 - 3, The shell script is missing the -u flag in its error
handling setup. Replace the two separate set commands (set -e and set -o
pipefail) with a single combined command that includes the -u flag (set -euo
pipefail) at the beginning of the script to ensure unset environment variables
are caught and cause the script to exit with a clear error rather than silently
expanding to empty strings.

Source: Coding guidelines

Comment on lines +20 to +25
if [[ -f "${SHARED_DIR}/cluster_name" ]]; then
CLUSTER_NAME=$(cat "${SHARED_DIR}/cluster_name")
fi

KUBECONFIG_PATH="/home/telcov10n/project/generated/${CLUSTER_NAME}/auth/kubeconfig"

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Verify whether the step ref guarantees CLUSTER_NAME in env.
fd -i 'telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-ref.yaml' ci-operator/step-registry --exec sed -n '1,220p' {}

Repository: openshift/release

Length of output: 675


🏁 Script executed:

cat -n ci-operator/step-registry/telcov10n/functional/cnf-ran/ibu-target-mirror-ocp/telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-commands.sh

Repository: openshift/release

Length of output: 1397


🏁 Script executed:

# Search for workflows/chains that use this step
fd -i 'ibu-target-mirror-ocp' ci-operator/step-registry --exec grep -l {} \; 2>/dev/null | head -20

Repository: openshift/release

Length of output: 43


🏁 Script executed:

# Check if CLUSTER_NAME is used elsewhere in similar telcov10n steps
rg 'CLUSTER_NAME' ci-operator/step-registry/telcov10n --type sh -B 2 -A 2 | head -50

Repository: openshift/release

Length of output: 9914


Validate CLUSTER_NAME before deriving kubeconfig path.

CLUSTER_NAME is only conditionally assigned from ${SHARED_DIR}/cluster_name, but used unconditionally on line 24 to construct KUBECONFIG_PATH. If the file doesn't exist and CLUSTER_NAME is not pre-set, the path becomes invalid (/home/telcov10n/project/generated//auth/kubeconfig). The step's ref file does not declare CLUSTER_NAME in env, so it must be guaranteed externally.

Suggested patch
 if [[ -f "${SHARED_DIR}/cluster_name" ]]; then
   CLUSTER_NAME=$(cat "${SHARED_DIR}/cluster_name")
 fi
 
+if [[ -z "${CLUSTER_NAME:-}" ]]; then
+  echo "ERROR: CLUSTER_NAME is empty and ${SHARED_DIR}/cluster_name was not found" >&2
+  exit 1
+fi
+
 KUBECONFIG_PATH="/home/telcov10n/project/generated/${CLUSTER_NAME}/auth/kubeconfig"
🤖 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/telcov10n/functional/cnf-ran/ibu-target-mirror-ocp/telcov10n-functional-cnf-ran-ibu-target-mirror-ocp-commands.sh`
around lines 20 - 25, The CLUSTER_NAME variable is only conditionally assigned
when the file at ${SHARED_DIR}/cluster_name exists, but it is then used
unconditionally in the KUBECONFIG_PATH construction. If the file does not exist
and CLUSTER_NAME is not pre-set, the path will be malformed. Add validation
after the conditional block to check that CLUSTER_NAME is not empty, and either
exit with an error message or set a default value if appropriate for your use
case. This ensures KUBECONFIG_PATH always has a valid cluster name.

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

@shaior: The following test 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/rehearse/periodic-ci-openshift-kni-eco-ci-cd-main-cnf-ran-ibu-4.20-cnf-ran-ztp-tests 7ecf756 link unknown /pj-rehearse periodic-ci-openshift-kni-eco-ci-cd-main-cnf-ran-ibu-4.20-cnf-ran-ztp-tests

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.

@shaior

shaior commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-kni-eco-ci-cd-main-cnf-ran-ibu-4.20-cnf-ran-ztp-tests

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@shaior: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant