Skip to content

USHIFT-7271: Treat all C2CC clusters as remote#7010

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
pmtk:c2cc/rf/no-local-clusters
Jul 8, 2026
Merged

USHIFT-7271: Treat all C2CC clusters as remote#7010
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
pmtk:c2cc/rf/no-local-clusters

Conversation

@pmtk

@pmtk pmtk commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • C2CC test setups now register all three clusters through a shared workflow, making cluster initialization more consistent across suites.
    • Added support for using the primary cluster’s kubeconfig and IPv6 details in dual-stack test runs.
  • Bug Fixes

    • Improved test startup reliability by waiting for readiness on all clusters before running scenarios.
    • Simplified teardown so remote cluster connections are cleaned up more consistently across suites.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 8, 2026

Copy link
Copy Markdown

@pmtk: This pull request references USHIFT-7271 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 "5.0.0" version, but no target version was set.

Details

In response to this:

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 8, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The test runner now fetches host1's kubeconfig and waits for readiness on all three hosts. A new Register All C2CC Clusters keyword and simplified Teardown All Remote Clusters keyword were added, and all C2CC robot suites' Setup/Teardown were refactored to use these shared keywords instead of inline login/kubeconfig/registration logic.

Changes

C2CC shared keyword refactor and suite updates

Layer / File(s) Summary
Shared kubeconfig fetch and cluster registration keywords
test/bin/c2cc_common.sh, test/resources/c2cc.resource
Runner fetches host1 kubeconfig, waits for readiness on all hosts, and passes KUBECONFIG_A; new ${KUBECONFIG_A}/${HOST1_IPV6} variables and Register All C2CC Clusters keyword added; Teardown All Remote Clusters simplified to close SSH connections for tracked aliases only.
Robot suite Setup/Teardown migration
test/suites/c2cc-ipsec/ipsec.robot, test/suites/c2cc/cleanup.robot, test/suites/c2cc/connectivity.robot, test/suites/c2cc/custom-route-tables.robot, test/suites/c2cc/disruptive.robot, test/suites/c2cc/dns.robot, test/suites/c2cc/healthcheck.robot, test/suites/c2cc/infrastructure.robot, test/suites/c2cc/probe.robot, test/suites/c2cc/reconciliation.robot, test/suites/c2cc/sanity.robot
All suites' Setup keywords replace explicit host login/kubeconfig setup/per-cluster registration with Register All C2CC Clusters (or direct Register Remote Cluster calls), and Teardown keywords drop explicit kubeconfig removal and host logout in favor of Teardown All Remote Clusters.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Suite as Robot Suite
  participant Resource as c2cc.resource
  participant Runner as c2cc_common.sh

  Runner->>Runner: fetch kubeconfig-a/b/c, wait for readiness
  Suite->>Resource: Register All C2CC Clusters
  Resource->>Resource: Register cluster-a/b/c as remote clusters
  Suite->>Suite: Deploy/Run tests
  Suite->>Resource: Teardown All Remote Clusters
  Resource->>Resource: Close SSH connections, clear alias list
Loading

Suggested labels: ready-for-human-review


Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Weak-Crypto ❌ Error The diff still includes DES-CBC3-SHA in the TLS profile source/docs (etcd/vendor/github.com/openshift/api/config/v1/types_tlssecurityprofile.go), violating the weak-crypto rule. Remove weak cipher suites like DES-CBC3-SHA from the touched TLS profile code/docs, or revert the unrelated vendor/API regeneration if it was unintended.
✅ 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 matches the main change: all C2CC clusters are now treated as remote.
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 Only Robot/sh files changed; no Ginkgo It/Describe/Context/When titles were added or modified, so no unstable test names.
Test Structure And Quality ✅ Passed No Ginkgo/Go test files changed; the PR only updates Robot Framework and shell helpers, so the Ginkgo-specific quality checks aren’t applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only refactors Robot suites/keywords and I found no MicroShift-unsupported APIs or tags.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The PR only changes Robot/shell C2CC setup; no new Go/Ginkgo e2e tests were added, so the SNO-specific check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Only test/Robot and shell harness files changed; no deployment manifests, operators, or controllers were modified, so no topology-sensitive scheduling logic was introduced.
Ote Binary Stdout Contract ✅ Passed No Go entrypoints or suite setup code changed; the PR only edits Robot/shell support files, so it doesn't affect OTE binary stdout contracts.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only refactors Robot setup/teardown and uses existing IPv6-aware helpers, with no public-internet dependency found.
Container-Privileges ✅ Passed Diff only changes test shell/Robot files; no container/K8s manifests or privileged/host*/SYS_ADMIN/allowPrivilegeEscalation settings were introduced.
No-Sensitive-Data-In-Logs ✅ Passed No new Log/echo/print statements were added; the diff only passes kubeconfig/IP vars into existing keywords and refactors setup/teardown.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 8, 2026
@openshift-ci openshift-ci Bot requested review from jerpeter1 and kasturinarra July 8, 2026 12:01
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmtk

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 Jul 8, 2026

@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.

🧹 Nitpick comments (2)
test/bin/c2cc_common.sh (1)

282-287: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Predictable /tmp kubeconfig paths flagged by static analysis.

Hardcoded /tmp/kubeconfig-{a,b,c} paths on the remote VM are susceptible to symlink/TOCTOU pre-planting (CWE-377). Use mktemp on the remote host instead of a fixed name.

🔒 Proposed fix using mktemp
-    run_command_on_vm host1 "sudo cp /var/lib/microshift/resources/kubeadmin/${host1_ip}/kubeconfig /tmp/kubeconfig-a && sudo chmod 644 /tmp/kubeconfig-a"
-    run_command_on_vm host2 "sudo cp /var/lib/microshift/resources/kubeadmin/${host2_ip}/kubeconfig /tmp/kubeconfig-b && sudo chmod 644 /tmp/kubeconfig-b"
-    run_command_on_vm host3 "sudo cp /var/lib/microshift/resources/kubeadmin/${host3_ip}/kubeconfig /tmp/kubeconfig-c && sudo chmod 644 /tmp/kubeconfig-c"
-    copy_file_from_vm host1 "/tmp/kubeconfig-a" "${kubeconfig_a}"
-    copy_file_from_vm host2 "/tmp/kubeconfig-b" "${kubeconfig_b}"
-    copy_file_from_vm host3 "/tmp/kubeconfig-c" "${kubeconfig_c}"
+    local tmp_a tmp_b tmp_c
+    tmp_a=$(run_command_on_vm host1 "mktemp")
+    tmp_b=$(run_command_on_vm host2 "mktemp")
+    tmp_c=$(run_command_on_vm host3 "mktemp")
+    run_command_on_vm host1 "sudo cp /var/lib/microshift/resources/kubeadmin/${host1_ip}/kubeconfig ${tmp_a} && sudo chmod 644 ${tmp_a}"
+    run_command_on_vm host2 "sudo cp /var/lib/microshift/resources/kubeadmin/${host2_ip}/kubeconfig ${tmp_b} && sudo chmod 644 ${tmp_b}"
+    run_command_on_vm host3 "sudo cp /var/lib/microshift/resources/kubeadmin/${host3_ip}/kubeconfig ${tmp_c} && sudo chmod 644 ${tmp_c}"
+    copy_file_from_vm host1 "${tmp_a}" "${kubeconfig_a}"
+    copy_file_from_vm host2 "${tmp_b}" "${kubeconfig_b}"
+    copy_file_from_vm host3 "${tmp_c}" "${kubeconfig_c}"
🤖 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 `@test/bin/c2cc_common.sh` around lines 282 - 287, The kubeconfig copy steps in
the c2cc_common.sh flow use predictable /tmp/kubeconfig-a/b/c remote filenames,
which should be replaced to avoid symlink/TOCTOU issues. Update the logic around
run_command_on_vm and copy_file_from_vm to create each remote kubeconfig path
with mktemp on the target VM, then copy from that generated path back to the
local kubeconfig variables. Keep the same host1/host2/host3 handling, but remove
all fixed /tmp/kubeconfig-* names.

Source: Linters/SAST tools

test/suites/c2cc/healthcheck.robot (1)

66-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Stale Teardown docstring.

Says "clean up kubeconfigs" but Teardown All Remote Clusters (per test/resources/c2cc.resource) only closes SSH connections and clears the alias list—no kubeconfig cleanup happens anymore.

📝 Proposed fix
 Teardown
-    [Documentation]    Close all connections and clean up kubeconfigs.
+    [Documentation]    Close all connections.
     Teardown All Remote Clusters
🤖 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 `@test/suites/c2cc/healthcheck.robot` around lines 66 - 68, The `Teardown`
documentation in `healthcheck.robot` is stale because `Teardown All Remote
Clusters` no longer cleans up kubeconfigs. Update the `[Documentation]` text to
match the actual behavior implemented by `Teardown All Remote Clusters` in
`c2cc.resource`, which only closes SSH connections and clears the alias list,
and remove any mention of kubeconfig cleanup.
🤖 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.

Nitpick comments:
In `@test/bin/c2cc_common.sh`:
- Around line 282-287: The kubeconfig copy steps in the c2cc_common.sh flow use
predictable /tmp/kubeconfig-a/b/c remote filenames, which should be replaced to
avoid symlink/TOCTOU issues. Update the logic around run_command_on_vm and
copy_file_from_vm to create each remote kubeconfig path with mktemp on the
target VM, then copy from that generated path back to the local kubeconfig
variables. Keep the same host1/host2/host3 handling, but remove all fixed
/tmp/kubeconfig-* names.

In `@test/suites/c2cc/healthcheck.robot`:
- Around line 66-68: The `Teardown` documentation in `healthcheck.robot` is
stale because `Teardown All Remote Clusters` no longer cleans up kubeconfigs.
Update the `[Documentation]` text to match the actual behavior implemented by
`Teardown All Remote Clusters` in `c2cc.resource`, which only closes SSH
connections and clears the alias list, and remove any mention of kubeconfig
cleanup.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 43ef42f6-30d4-49e5-81eb-ecaa5f893ba4

📥 Commits

Reviewing files that changed from the base of the PR and between d4dc9fc and 3125d17.

📒 Files selected for processing (13)
  • test/bin/c2cc_common.sh
  • test/resources/c2cc.resource
  • test/suites/c2cc-ipsec/ipsec.robot
  • test/suites/c2cc/cleanup.robot
  • test/suites/c2cc/connectivity.robot
  • test/suites/c2cc/custom-route-tables.robot
  • test/suites/c2cc/disruptive.robot
  • test/suites/c2cc/dns.robot
  • test/suites/c2cc/healthcheck.robot
  • test/suites/c2cc/infrastructure.robot
  • test/suites/c2cc/probe.robot
  • test/suites/c2cc/reconciliation.robot
  • test/suites/c2cc/sanity.robot

@agullon

agullon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-aws-tests-bootc-periodic-arm-el10
/override ci/prow/e2e-aws-tests-bootc-periodic-el10
/override ci/prow/e2e-aws-tests-periodic

@agullon

agullon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@agullon

agullon commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 8, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@agullon: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 8, 2026
@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@agullon: Overrode contexts on behalf of agullon: ci/prow/e2e-aws-tests-bootc-periodic-arm-el10, ci/prow/e2e-aws-tests-bootc-periodic-el10, ci/prow/e2e-aws-tests-periodic

Details

In response to this:

/override ci/prow/e2e-aws-tests-bootc-periodic-arm-el10
/override ci/prow/e2e-aws-tests-bootc-periodic-el10
/override ci/prow/e2e-aws-tests-periodic

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.

@openshift-ci

openshift-ci Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@pmtk: 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.

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. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants