Skip to content

Commit 010acd6

Browse files
#1940: Block v2v pod creation or disable start migration if vddk is not uploaded (#1969)
1 parent 4880558 commit 010acd6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ui/src/features/migration/components/MigrationsTable.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { keyframes } from '@mui/material/styles'
2222
import { useMigrationFormActions } from '../context/MigrationFormContext'
2323
import { useVmwareCredentialsQuery } from 'src/hooks/api/useVmwareCredentialsQuery'
2424
import { useOpenstackCredentialsQuery } from 'src/hooks/api/useOpenstackCredentialsQuery'
25+
import { useVddkStatusQuery } from 'src/hooks/api/useVddkStatusQuery'
2526
import type { CustomToolbarProps, MigrationsTableProps } from '../types'
2627
import { TooltipContent, ClickableTableCell } from 'src/components'
2728
import { useMigrationPlanDestinationsQuery } from '../api/useMigrationPlanDestinationsQuery'
@@ -132,6 +133,8 @@ export default function MigrationsTable({
132133
refetchOnMount: true
133134
})
134135

136+
const { data: vddkStatus } = useVddkStatusQuery({ staleTime: 0, refetchOnMount: true })
137+
135138
const hasVmwareCredentials = useMemo(() => (vmwareCreds || []).length > 0, [vmwareCreds])
136139
const hasPcdCredentials = useMemo(() => {
137140
const openstack = Array.isArray(openstackCreds) ? openstackCreds : []
@@ -141,9 +144,12 @@ export default function MigrationsTable({
141144
).length > 0
142145
)
143146
}, [openstackCreds])
147+
const vddkUploaded = vddkStatus?.uploaded === true
144148

145-
const startMigrationDisabled = !hasVmwareCredentials || !hasPcdCredentials
146-
const startMigrationDisabledReason = 'Add VMware and PCD credentials before starting a migration.'
149+
const startMigrationDisabled = !hasVmwareCredentials || !hasPcdCredentials || !vddkUploaded
150+
const startMigrationDisabledReason = !vddkUploaded
151+
? 'Upload VDDK library in Settings before starting a migration.'
152+
: 'Add VMware and PCD credentials before starting a migration.'
147153
const [selectedRows, setSelectedRows] = useState<GridRowSelectionModel>([])
148154
const [isBulkCutoverLoading, setIsBulkCutoverLoading] = useState(false)
149155
const [bulkCutoverDialogOpen, setBulkCutoverDialogOpen] = useState(false)

0 commit comments

Comments
 (0)