diff --git a/cmd/migration-manager/internal/cmds/warnings.go b/cmd/migration-manager/internal/cmds/warnings.go index 8583d537..592ad1b7 100644 --- a/cmd/migration-manager/internal/cmds/warnings.go +++ b/cmd/migration-manager/internal/cmds/warnings.go @@ -28,16 +28,16 @@ func (c *CmdWarning) Command() *cobra.Command { ` // List - configListCmd := cmdWarningList{global: c.Global} - cmd.AddCommand(configListCmd.Command()) + warningListCmd := cmdWarningList{global: c.Global} + cmd.AddCommand(warningListCmd.Command()) // Show - configShowCmd := cmdWarningShow{global: c.Global} - cmd.AddCommand(configShowCmd.Command()) + warningShowCmd := cmdWarningShow{global: c.Global} + cmd.AddCommand(warningShowCmd.Command()) // Acknowledge - configAck := cmdWarningAck{global: c.Global} - cmd.AddCommand(configAck.Command()) + warningAck := cmdWarningAck{global: c.Global} + cmd.AddCommand(warningAck.Command()) // Workaround for subcommand usage errors. See: https://github.com/spf13/cobra/issues/706 cmd.Args = cobra.NoArgs diff --git a/cmd/migration-managerd/internal/api/migration_test.go b/cmd/migration-managerd/internal/api/migration_test.go index df93d048..0a47dca1 100644 --- a/cmd/migration-managerd/internal/api/migration_test.go +++ b/cmd/migration-managerd/internal/api/migration_test.go @@ -653,8 +653,8 @@ def placement(instance, batch): tgt := target.InternalIncusTarget{InternalTarget: target.NewInternalTarget(t, "6.0")} return tgt.CreateVMDefinition(instanceDef, usedNetworks, q, fingerprint, endpoint, targeNetwork) }, - CreateNewVMFunc: func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(), error) { - return func(_ context.Context) error { return nil }, func() { ranCleanup = true }, nil + CreateNewVMFunc: func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(t target.Target), error) { + return func(_ context.Context) error { return nil }, func(t target.Target) { ranCleanup = true }, nil }, SetupVMFunc: func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement) error { return nil diff --git a/internal/migration/warning_model.go b/internal/migration/warning_model.go index 0c17c70b..7d2e67df 100644 --- a/internal/migration/warning_model.go +++ b/internal/migration/warning_model.go @@ -60,7 +60,7 @@ func (w Warning) Validate() error { } if w.Entity == "" { - return NewValidationErrf("Warning %q cannot have empty type", w.UUID) + return NewValidationErrf("Warning %q cannot have empty entity", w.UUID) } if w.Status == "" { diff --git a/internal/target/mock_gen.go b/internal/target/mock_gen.go index 69d0d121..7a9995be 100644 --- a/internal/target/mock_gen.go +++ b/internal/target/mock_gen.go @@ -35,7 +35,7 @@ var _ Target = &TargetMock{} // ConnectFunc: func(ctx context.Context) error { // panic("mock out the Connect method") // }, -// CreateNewVMFunc: func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(), error) { +// CreateNewVMFunc: func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(t Target), error) { // panic("mock out the CreateNewVM method") // }, // CreateStoragePoolVolumeFromBackupFunc: func(ctx context.Context, poolName string, backupFilePath string, architecture string, volumeName string) error { @@ -130,7 +130,7 @@ type TargetMock struct { ConnectFunc func(ctx context.Context) error // CreateNewVMFunc mocks the CreateNewVM method. - CreateNewVMFunc func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(), error) + CreateNewVMFunc func(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(t Target), error) // CreateStoragePoolVolumeFromBackupFunc mocks the CreateStoragePoolVolumeFromBackup method. CreateStoragePoolVolumeFromBackupFunc func(ctx context.Context, poolName string, backupFilePath string, architecture string, volumeName string) error @@ -547,7 +547,7 @@ func (mock *TargetMock) ConnectCalls() []struct { } // CreateNewVM calls CreateNewVMFunc. -func (mock *TargetMock) CreateNewVM(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(), error) { +func (mock *TargetMock) CreateNewVM(ctx context.Context, instDef migration.Instance, apiDef incusAPI.InstancesPost, placement api.Placement, bootISOImage string) (func(context.Context) error, func(t Target), error) { if mock.CreateNewVMFunc == nil { panic("TargetMock.CreateNewVMFunc: method is nil but Target.CreateNewVM was just called") }