Skip to content

Commit

Permalink
fix: wrong src and dst when copying vmgs/rootfs/hash device (#2125)
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim An <maksiman@microsoft.com>
  • Loading branch information
anmaxvl committed May 6, 2024
1 parent e2b26fa commit b0ae328
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/uvm/create_lcow.go
Expand Up @@ -375,7 +375,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_
}

vmgsFileFullPath := filepath.Join(opts.BundleDirectory, opts.GuestStateFile)
if err := copyfile.CopyFile(ctx, vmgsFileFullPath, vmgsTemplatePath, true); err != nil {
if err := copyfile.CopyFile(ctx, vmgsTemplatePath, vmgsFileFullPath, true); err != nil {
return nil, fmt.Errorf("failed to copy VMGS template file: %w", err)
}
defer func() {
Expand All @@ -385,7 +385,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_
}()

dmVerityRootFsFullPath := filepath.Join(opts.BundleDirectory, DefaultDmVerityRootfsVhd)
if err := copyfile.CopyFile(ctx, dmVerityRootFsFullPath, dmVerityRootfsTemplatePath, true); err != nil {
if err := copyfile.CopyFile(ctx, dmVerityRootfsTemplatePath, dmVerityRootFsFullPath, true); err != nil {
return nil, fmt.Errorf("failed to copy DM Verity rootfs template file: %w", err)
}
defer func() {
Expand All @@ -395,7 +395,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_
}()

dmVerityHashFullPath := filepath.Join(opts.BundleDirectory, DefaultDmVerityHashVhd)
if err := copyfile.CopyFile(ctx, dmVerityHashFullPath, dmVerityHashTemplatePath, true); err != nil {
if err := copyfile.CopyFile(ctx, dmVerityHashTemplatePath, dmVerityHashFullPath, true); err != nil {
return nil, fmt.Errorf("failed to copy DM Verity hash template file: %w", err)
}
defer func() {
Expand Down

0 comments on commit b0ae328

Please sign in to comment.