Skip to content

#1692 : Support multiple IP addresses per network interface#1697

Open
AbhijeetThakur wants to merge 3 commits intomainfrom
private/abhijeet/1692
Open

#1692 : Support multiple IP addresses per network interface#1697
AbhijeetThakur wants to merge 3 commits intomainfrom
private/abhijeet/1692

Conversation

@AbhijeetThakur
Copy link
Collaborator

What this PR does / why we need it

  • I updated the ipAddress field in the VmNetworkInterface model to accept an array of strings instead of just a single string. This change was applied across all migration templates and VMware machines.
  • I also refined the user interface logic to support lists of IPs that are separated by commas, ensuring that we validate each IP address individually and display all of them correctly. Additionally, I improved the bulk IP assignment feature so that it flattens the list and checks each IP for validity while keeping track of the validation status for each network interface.

Which issue(s) this PR fixes

fixes #

Testing done

Screencast.from.16-03-26.10.50.54.PM.IST.webm

Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

Other comments (2)
  • ui/src/features/migration/VmsSelectionStep.tsx (194-204) The `normalizeNetworkInterfaces` function uses `any` type casting which bypasses TypeScript's type checking. Consider updating the function to use proper typing for better type safety.
    const normalizeNetworkInterfaces = (networkInterfaces?: VmData['networkInterfaces']) => {
      if (!networkInterfaces || networkInterfaces.length === 0) return networkInterfaces
      return networkInterfaces.map((nic) => ({
        ...nic,
        ipAddress: Array.isArray(nic.ipAddress)
          ? nic.ipAddress
          : nic.ipAddress
            ? [nic.ipAddress]
            : []
      }))
    }
    
  • ui/src/features/migration/RollingMigrationForm.tsx (2749-2749) There's inconsistency in how empty IP values are handled. In some places you're setting `ipAddress: []` and in others you're checking if `ip.trim() !== ''`. For consistency, always use the empty array approach when there's no IP address.

💡 To request another review, post a new comment with "/windsurf-review".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant