Skip to content

Commit

Permalink
Ensure all predicates are evaluated
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <[email protected]>
  • Loading branch information
mansam authored and mnecas committed Nov 14, 2024
1 parent bcd88be commit cc7c7e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion pkg/controller/plan/adapter/vsphere/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,13 @@ func (r *Client) GetSnapshotDeltas(vmRef ref.Ref, snapshotId string, hosts util.
case *types.VirtualDiskRawDiskVer2BackingInfo:
changeIdMapping[trimBackingFileName(dev.DescriptorFileName)] = dev.ChangeId
}

}

r.Log.V(1).Info("GetSnapshotDeltas",
"vmRef", vmRef,
"snapshot", snapshotId,
"deltas", changeIdMapping)

return
}

Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/plan/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var (
CDIDiskCopy libitr.Flag = 0x08
VirtV2vDiskCopy libitr.Flag = 0x10
OpenstackImageMigration libitr.Flag = 0x20
VSphere libitr.Flag = 0x30
VSphere libitr.Flag = 0x40
)

// Phases.
Expand Down Expand Up @@ -79,7 +79,7 @@ const (
WaitForInitialSnapshot = "WaitForInitialSnapshot"
WaitForFinalSnapshot = "WaitForFinalSnapshot"
ConvertOpenstackSnapshot = "ConvertOpenstackSnapshot"
GetSnapshotDeltas = "GetSnapshotDeltas"
StoreSnapshotDeltas = "StoreSnapshotDeltas"
StoreInitialSnapshotDeltas = "StoreInitialSnapshotDeltas"
RemovePreviousSnapshot = "RemovePreviousSnapshot"
RemovePenultimateSnapshot = "RemovePenultimateSnapshot"
Expand Down Expand Up @@ -138,7 +138,7 @@ var (
{Name: RemovePreviousSnapshot, All: VSphere},
{Name: CreateSnapshot},
{Name: WaitForSnapshot},
{Name: GetSnapshotDeltas, All: VSphere},
{Name: StoreSnapshotDeltas, All: VSphere},
{Name: AddCheckpoint},
{Name: StorePowerState},
{Name: PowerOffSource},
Expand Down Expand Up @@ -661,7 +661,7 @@ func (r *Migration) step(vm *plan.VMStatus) (step string) {
step = Initialize
case AllocateDisks:
step = DiskAllocation
case CopyDisks, CopyingPaused, RemovePreviousSnapshot, CreateSnapshot, WaitForSnapshot, GetSnapshotDeltas, AddCheckpoint, ConvertOpenstackSnapshot:
case CopyDisks, CopyingPaused, RemovePreviousSnapshot, CreateSnapshot, WaitForSnapshot, StoreSnapshotDeltas, AddCheckpoint, ConvertOpenstackSnapshot:
step = DiskTransfer
case RemovePenultimateSnapshot, CreateFinalSnapshot, WaitForFinalSnapshot, AddFinalCheckpoint, Finalize, RemoveFinalSnapshot:
step = Cutover
Expand Down Expand Up @@ -1038,7 +1038,7 @@ func (r *Migration) execute(vm *plan.VMStatus) (err error) {
if ready {
vm.Phase = r.next(vm.Phase)
}
case StoreInitialSnapshotDeltas, GetSnapshotDeltas:
case StoreInitialSnapshotDeltas, StoreSnapshotDeltas:
step, found := vm.FindStep(r.step(vm))
if !found {
vm.AddError(fmt.Sprintf("Step '%s' not found", r.step(vm)))
Expand Down
2 changes: 1 addition & 1 deletion pkg/lib/itinerary/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
liberr "github.com/konveyor/forklift-controller/pkg/lib/error"
)

const NumPredicates = 24
const NumPredicates = 0x40

// List of steps.
type Pipeline []Step
Expand Down

0 comments on commit cc7c7e4

Please sign in to comment.