Skip to content

Conversation

@adamviktora
Copy link
Member

@adamviktora adamviktora commented Feb 4, 2026

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
    • done by fetching this resource:
      kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster
    • and checking that every status.clusterNetwork and status.serviceNetwork is IPv6

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
    • for Create from InstanceType, Template, YAML options
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

Summary by CodeRabbit

  • New Features

    • Detects IPv6 single‑stack clusters and prevents incompatible Pod networking.
    • Shows warning alerts when Pod networking is present on IPv6 single‑stack clusters.
    • Adds guidance to customize VM network interfaces during creation.
  • Bug Fixes

    • Corrected typo in NetworkAttachmentDefinition label across the UI.
    • Improves handling/display when network data is empty.
  • Localization

    • Added translations for new IPv6 and networking messages (EN, ES, FR, JA, KO, ZH).

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 4, 2026

@adamviktora: This pull request references CNV-77599 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
  • done by fetching this resource:
    kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

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
Copy link
Contributor

openshift-ci bot commented Feb 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adamviktora

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 This issue is something we want to fix label Feb 4, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Adds IPv6 single‑stack detection and behavior: new hook and model, UI warnings and translations, and changes to VM generation and network selection to omit Pod networking when cluster is IPv6 single‑stack.

Changes

Cohort / File(s) Summary
Locale Translation Updates
locales/en/plugin__kubevirt-plugin.json, locales/es/plugin__kubevirt-plugin.json, locales/fr/plugin__kubevirt-plugin.json, locales/ja/plugin__kubevirt-plugin.json, locales/ko/plugin__kubevirt-plugin.json, locales/zh/plugin__kubevirt-plugin.json
Added IPv6 single‑stack Pod networking warning and VM customization guidance keys; fixed typo Select NetwrokAttachmentDefinitionSelect NetworkAttachmentDefinition across locales.
IPv6 Detection Infrastructure
src/utils/hooks/useIsIPv6SingleStackCluster.ts, src/utils/models/index.ts
New hook useIsIPv6SingleStackCluster to detect IPv6 single‑stack clusters and exported NetworkConfigModel K8s model for network config access.
Network Selection Gating
src/utils/components/.../NetworkInterfaceNetworkSelect.tsx
Integrated IPv6 single‑stack check to hide/disable Pod networking option when cluster is IPv6 single‑stack.
VM Template / YAML
src/templates/vm-yaml.ts, src/views/virtualmachines/navigator/VirtualMachineNavigator.tsx
defaultVMYamlTemplate gained isIPv6SingleStack parameter; templates omit default interface/network when flag is true; navigator passes flag into initial VM.
VM Generation & Quick Create
src/views/catalog/CreateFromInstanceTypes/.../useGeneratedVM.ts, src/views/catalog/CreateFromInstanceTypes/utils/utils.ts, src/views/catalog/utils/quick-create-vm.ts
Propagated isIPv6SingleStack into VM generation and quick‑create flows; when true, prune interfaces/networks and disable autoattachPodInterface.
Template Catalog & Drawer
src/views/catalog/templatescatalog/components/TemplateInfoSection.tsx, src/views/catalog/templatescatalog/components/.../useCreateDrawerForm.tsx
Added Pod‑network IPv6 single‑stack alert in template info UI; integrated IPv6 checks into drawer/create flows to sanitize networks/interfaces.
UI/Form Small Fixes
src/views/catalog/wizard/tabs/overview/components/WizardOverviewNetworksTable/WizardOverviewNetworksTable.tsx, src/views/checkups/network/components/form/CheckupsNetworkFormNADS.tsx
Added empty‑state guard for networks table; corrected NAD selector placeholder typo to Select NetworkAttachmentDefinition.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • gouyang
  • batyana
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description addresses the template structure with a title, description section with bullet points explaining changes, and a demo link showing the feature in action.
Title check ✅ Passed The title accurately summarizes the main change: preventing VMs from connecting to Pod networks on IPv6 single-stack clusters, which aligns with the substantial implementation across hook creation, UI modifications, VM template generation, and localization updates.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 4, 2026

@adamviktora: This pull request references CNV-77599 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
  • done by fetching this resource:
    kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

Summary by CodeRabbit

  • New Features

  • Added IPv6 single-stack cluster detection to prevent Pod networking in incompatible clusters.

  • Introduced warning alerts when Pod networking is selected on IPv6 single-stack clusters.

  • Added guidance for customizing VM network interfaces.

  • Bug Fixes

  • Fixed typo in network attachment definition label across UI and all translations.

  • Improved handling of empty network data display.

  • Localization

  • Added translations for new IPv6 and networking messages in English, Spanish, French, Japanese, Korean, and Chinese.

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

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/components/NetworkInterfaceModal/components/NetworkInterfaceNetworkSelect/NetworkInterfaceNetworkSelect.tsx (1)

117-125: ⚠️ Potential issue | 🟠 Major

Block submit when IPv6 single‑stack removes Pod networking and no NADs exist.

Line 123 currently treats !hasPodNetwork as sufficient to allow creation, but in IPv6 single‑stack the pod option is removed, so the form can be “valid” with zero options. Please tie eligibility to the actual option availability.

🛠️ Suggested fix
-  const canCreateNetworkInterface = useMemo(
-    () => hasNads || !hasPodNetwork,
-    [hasNads, hasPodNetwork],
-  );
+  const canCreateNetworkInterface = useMemo(
+    () => hasNads || isPodNetworkingOptionExists,
+    [hasNads, isPodNetworkingOptionExists],
+  );
🤖 Fix all issues with AI agents
In `@src/utils/hooks/useIsIPv6SingleStackCluster.ts`:
- Around line 23-30: The computed isIPv6SingleStack in useIsIPv6SingleStack can
be undefined when networkConfig or its nested properties are missing; change the
useMemo to coerce the result to a boolean (e.g., wrap the existing expression
with Boolean(...) or add a fallback `|| false`) so the hook always returns a
boolean, referencing the isIPv6SingleStack variable and the
networkConfig?.status?.clusterNetwork/serviceNetwork checks within the useMemo
in useIsIPv6SingleStack.

In `@src/views/catalog/utils/quick-create-vm.ts`:
- Around line 101-109: The current block in isIPv6SingleStack can throw if
getInterfaces(draftVM) or getNetworks(draftVM) returns undefined; change the
assignments to defensively handle undefined by treating results as empty arrays
(e.g., use a fallback like (getInterfaces(draftVM) || []) and
(getNetworks(draftVM) || []) before calling .filter) so
draftVM.spec.template.spec.domain.devices.interfaces and
draftVM.spec.template.spec.networks are always set to arrays, then keep setting
draftVM.spec.template.spec.domain.devices.autoattachPodInterface = false;
reference getInterfaces, getNetworks, isPodNetwork, DEFAULT_NETWORK_INTERFACE
and the draftVM.spec.template.spec.domain.devices.* properties when making the
fix.

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 4, 2026

@adamviktora: This pull request references CNV-77599 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
  • done by fetching this resource:
    kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
  • for Create from InstanceType, Template, YAML options
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

Summary by CodeRabbit

  • New Features

  • Added IPv6 single-stack cluster detection to prevent Pod networking in incompatible clusters.

  • Introduced warning alerts when Pod networking is selected on IPv6 single-stack clusters.

  • Added guidance for customizing VM network interfaces.

  • Bug Fixes

  • Fixed typo in network attachment definition label across UI and all translations.

  • Improved handling of empty network data display.

  • Localization

  • Added translations for new IPv6 and networking messages in English, Spanish, French, Japanese, Korean, and Chinese.

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 4, 2026

@adamviktora: This pull request references CNV-77599 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
  • done by fetching this resource:
    kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
  • for Create from InstanceType, Template, YAML options
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

Summary by CodeRabbit

  • New Features

  • Detects IPv6 single‑stack clusters and prevents incompatible Pod networking.

  • Shows warning alerts when Pod networking is present on IPv6 single‑stack clusters.

  • Adds guidance to customize VM network interfaces during creation.

  • Bug Fixes

  • Corrected typo in NetworkAttachmentDefinition label across the UI.

  • Improves handling/display when network data is empty.

  • Localization

  • Added translations for new IPv6 and networking messages (EN, ES, FR, JA, KO, ZH).

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

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/views/virtualmachines/navigator/VirtualMachineNavigator.tsx (1)

42-72: ⚠️ Potential issue | 🟠 Major

Missing isIPv6SingleStack in useMemo dependency array.

isIPv6SingleStack is used inside the useMemo callback (line 47) but is not included in the dependency array (line 71). If isIPv6SingleStack changes after initial load (e.g., once the Network resource is fetched), the memoized value won't update, potentially showing an incorrect initial VM template.

🐛 Proposed fix
   return useMemo(
     () =>
       location.pathname.endsWith(`${VirtualMachineModelRef}/~new`) ? (
         <CreateResourceDefaultPage
           header={t('Create VirtualMachine')}
           initialResource={defaultVMYamlTemplate(isIPv6SingleStack)}
         />
       ) : (
         // ... rest of JSX
       ),
-    [isVirtualMachineListPage, cluster, location.pathname, namespace, t, treeProps],
+    [isVirtualMachineListPage, cluster, location.pathname, namespace, t, treeProps, isIPv6SingleStack, onFilterChange],
   );
🤖 Fix all issues with AI agents
In
`@src/views/catalog/templatescatalog/components/TemplatesCatalogDrawer/hooks/useCreateDrawerForm.tsx`:
- Around line 304-312: The code assumes getInterfaces(vmDraft) and
getNetworks(vmDraft) always return arrays; to prevent TypeError when they return
undefined, change the filtering to operate on a safe fallback array (e.g.,
(getInterfaces(vmDraft) ?? []) and (getNetworks(vmDraft) ?? [])) before calling
.filter(), and then assign those results to
vmDraft.spec.template.spec.domain.devices.interfaces and
vmDraft.spec.template.spec.networks; reference isIPv6SingleStack, vmDraft,
getInterfaces, getNetworks, DEFAULT_NETWORK_INTERFACE, and isPodNetwork when
making this defensive change.
🧹 Nitpick comments (1)
src/views/catalog/templatescatalog/components/TemplatesCatalogDrawer/TemplateInfoSection.tsx (1)

136-145: Move the Alert outside the DescriptionList.

PatternFly DescriptionList is a <dl> and expects only DescriptionListGroup children. Placing a raw Alert as a direct child breaks semantic HTML structure. Render it after the DescriptionList instead.

♻️ Possible structure
-      <DescriptionList>
-        ...
-        {isIPv6SingleStack && hasPodNetwork && (
-          <Alert
-            isInline
-            title={t("Can't use Pod networking in IPv6 single-stack cluster")}
-            variant="warning"
-          >
-            {networks.length === 1 &&
-              t('Click Customize VirtualMachine to add a different network interface')}
-          </Alert>
-        )}
-        ...
-      </DescriptionList>
+      <DescriptionList>
+        ...
+      </DescriptionList>
+      {isIPv6SingleStack && hasPodNetwork && (
+        <Alert
+          isInline
+          title={t("Can't use Pod networking in IPv6 single-stack cluster")}
+          variant="warning"
+        >
+          {networks.length === 1 &&
+            t('Click Customize VirtualMachine to add a different network interface')}
+        </Alert>
+      )}

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 4, 2026

@adamviktora: This pull request references CNV-77599 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

📝 Description

  • this PR adds a useIsIPv6SingleStackCluster hook to check if a cluster is IPv6 single-stack
  • done by fetching this resource:
    kind: Network apiVersion: config.openshift.io/v1 metadata.name: cluster
  • and checking that every status.clusterNetwork and status.serviceNetwork is IPv6

For an IPv6 single-stack cluster:

  • default interface and pod network is omitted in the VM spec during VM creation
  • for Create from InstanceType, Template, YAML options
  • "Pod networking" option is omitted in the Add / Edit network interface modal

🎥 Demo

After:

Screen.Recording.2026-02-04.at.9.45.38.mp4

Summary by CodeRabbit

  • New Features

  • Detects IPv6 single‑stack clusters and prevents incompatible Pod networking.

  • Shows warning alerts when Pod networking is present on IPv6 single‑stack clusters.

  • Adds guidance to customize VM network interfaces during creation.

  • Bug Fixes

  • Corrected typo in NetworkAttachmentDefinition label across the UI.

  • Improves handling/display when network data is empty.

  • Localization

  • Added translations for new IPv6 and networking messages (EN, ES, FR, JA, KO, ZH).

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.

@adamviktora adamviktora changed the title CNV-77599: don't connect VMs on IPv6 single-stack cluster to Pod network WIP: CNV-77599: don't connect VMs on IPv6 single-stack cluster to Pod network Feb 4, 2026
@adamviktora
Copy link
Member Author

Waiting for backend

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants