From cfafde1c4d04b46c0b83f48ce25244370f0bd1c9 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Tue, 30 Jul 2024 18:10:34 +0200 Subject: [PATCH 1/6] fix(controller): Move v4 client instantiation to reconcileDelete In order to reduce the number of calls made to /prism_central to establish whether a v4 client can be created, we move the v4 client creation to reconcileDelete function as currently that's the only place where we need to make v4 VG detach calls. --- controllers/nutanixcluster_controller.go | 16 --- controllers/nutanixmachine_controller.go | 166 ++++++++++++----------- pkg/context/context.go | 11 +- 3 files changed, 93 insertions(+), 100 deletions(-) diff --git a/controllers/nutanixcluster_controller.go b/controllers/nutanixcluster_controller.go index 25ac27b875..4a56bacdb5 100644 --- a/controllers/nutanixcluster_controller.go +++ b/controllers/nutanixcluster_controller.go @@ -201,22 +201,6 @@ func (r *NutanixClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque NutanixCluster: cluster, NutanixClient: v3Client, } - - createV4Client, err := isPrismCentralV4Compatible(ctx, v3Client) - if err != nil { - log.Error(err, "error occurred while checking environment compatibility for Prism Central v4 APIs") - } - - if createV4Client { - v4Client, err := getPrismCentralV4ClientForCluster(ctx, cluster, r.SecretInformer, r.ConfigMapInformer) - if err != nil { - log.Error(err, "error occurred while fetching Prism Central v4 client") - return reconcile.Result{}, err - } - - rctx.NutanixClientV4 = v4Client - } - // Check for request action if !cluster.DeletionTimestamp.IsZero() { // NutanixCluster is being deleted diff --git a/controllers/nutanixmachine_controller.go b/controllers/nutanixmachine_controller.go index 50e2cb008a..af9e4021f1 100644 --- a/controllers/nutanixmachine_controller.go +++ b/controllers/nutanixmachine_controller.go @@ -275,22 +275,6 @@ func (r *NutanixMachineReconciler) Reconcile(ctx context.Context, req ctrl.Reque NutanixClient: v3Client, } - createV4Client, err := isPrismCentralV4Compatible(ctx, v3Client) - if err != nil { - log.Error(err, "error occurred while checking compatibility for Prism Central v4 APIs") - } - - if createV4Client { - log.Info("Creating Prism Central v4 client for cluster", "cluster", ntxCluster.Name) - v4Client, err := getPrismCentralV4ClientForCluster(ctx, ntxCluster, r.SecretInformer, r.ConfigMapInformer) - if err != nil { - log.Error(err, "error occurred while fetching Prism Central v4 client") - return reconcile.Result{}, err - } - - rctx.NutanixClientV4 = v4Client - } - defer func() { if err == nil { // Always attempt to Patch the NutanixMachine object and its status after each reconciliation. @@ -327,81 +311,109 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r log.Error(errorMsg, "failed to delete VM") return reconcile.Result{}, errorMsg } + // Check if VMUUID is absent if vmUUID == "" { log.Info(fmt.Sprintf("VMUUID was not found in spec for VM %s. Skipping delete", vmName)) - } else { - // Search for VM by UUID - vm, err := FindVMByUUID(ctx, v3Client, vmUUID) - // Error while finding VM + log.Info(fmt.Sprintf("Removing finalizers for VM %s during delete reconciliation", vmName)) + ctrlutil.RemoveFinalizer(rctx.NutanixMachine, infrav1.NutanixMachineFinalizer) + return reconcile.Result{}, nil + } + + // Search for VM by UUID + vm, err := FindVMByUUID(ctx, v3Client, vmUUID) + // Error while finding VM + if err != nil { + errorMsg := fmt.Errorf("error finding vm %s with uuid %s: %v", vmName, vmUUID, err) + log.Error(errorMsg, "error finding vm") + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) + return reconcile.Result{}, errorMsg + } + + // Vm not found + if vm == nil { + log.Info(fmt.Sprintf("no vm found with UUID %s ... Already deleted? Skipping delete", vmUUID)) + log.Info(fmt.Sprintf("Removing finalizers for VM %s during delete reconciliation", vmName)) + ctrlutil.RemoveFinalizer(rctx.NutanixMachine, infrav1.NutanixMachineFinalizer) + return reconcile.Result{}, nil + } + + // Check if the VM name matches the Machine name or the NutanixMachine name. + // Earlier, we were creating VMs with the same name as the NutanixMachine name. + // Now, we create VMs with the same name as the Machine name in line with other CAPI providers. + // This check is to ensure that we are deleting the correct VM for both cases as older CAPX VMs + // will have the NutanixMachine name as the VM name. + if *vm.Spec.Name != vmName && *vm.Spec.Name != rctx.NutanixMachine.Name { + return reconcile.Result{}, fmt.Errorf("found VM with UUID %s but name %s did not match Machine name %s or NutanixMachineName %s", vmUUID, *vm.Spec.Name, vmName, rctx.NutanixMachine.Name) + } + + log.V(1).Info(fmt.Sprintf("VM %s with UUID %s was found.", *vm.Spec.Name, vmUUID)) + lastTaskUUID, err := GetTaskUUIDFromVM(vm) + if err != nil { + errorMsg := fmt.Errorf("error occurred fetching task UUID from vm: %v", err) + log.Error(errorMsg, "error fetching task UUID") + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) + return reconcile.Result{}, errorMsg + } + + if lastTaskUUID != "" { + log.Info(fmt.Sprintf("checking if VM %s with UUID %s has in progress tasks", vmName, vmUUID)) + taskInProgress, err := HasTaskInProgress(ctx, rctx.NutanixClient, lastTaskUUID) if err != nil { - errorMsg := fmt.Errorf("error finding vm %s with uuid %s: %v", vmName, vmUUID, err) - log.Error(errorMsg, "error finding vm") - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - return reconcile.Result{}, errorMsg + log.Error(err, fmt.Sprintf("error occurred while checking task %s for VM %s. Trying to delete VM", lastTaskUUID, vmName)) } - // Vm not found - if vm == nil { - log.V(1).Info(fmt.Sprintf("no vm found with UUID %s ... Already deleted? Skipping delete", vmUUID)) - } else { - // Check if the VM name matches the Machine name or the NutanixMachine name. - // Earlier, we were creating VMs with the same name as the NutanixMachine name. - // Now, we create VMs with the same name as the Machine name in line with other CAPI providers. - // This check is to ensure that we are deleting the correct VM for both cases as older CAPX VMs - // will have the NutanixMachine name as the VM name. - if *vm.Spec.Name != vmName && *vm.Spec.Name != rctx.NutanixMachine.Name { - return reconcile.Result{}, fmt.Errorf("found VM with UUID %s but name %s did not match Machine name %s or NutanixMachineName %s", vmUUID, *vm.Spec.Name, vmName, rctx.NutanixMachine.Name) - } - log.V(1).Info(fmt.Sprintf("VM %s with UUID %s was found.", *vm.Spec.Name, vmUUID)) - lastTaskUUID, err := GetTaskUUIDFromVM(vm) - if err != nil { - errorMsg := fmt.Errorf("error occurred fetching task UUID from vm: %v", err) - log.Error(errorMsg, "error fetching task UUID") - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - return reconcile.Result{}, errorMsg - } - if lastTaskUUID != "" { - log.Info(fmt.Sprintf("checking if VM %s with UUID %s has in progress tasks", vmName, vmUUID)) - taskInProgress, err := HasTaskInProgress(ctx, rctx.NutanixClient, lastTaskUUID) - if err != nil { - log.Error(err, fmt.Sprintf("error occurred while checking task %s for VM %s. Trying to delete VM", lastTaskUUID, vmName)) - } - if taskInProgress { - log.Info(fmt.Sprintf("VM %s task with UUID %s still in progress. Requeuing", vmName, vmUUID)) - return reconcile.Result{RequeueAfter: 5 * time.Second}, nil - } - log.V(1).Info(fmt.Sprintf("No running tasks anymore... Initiating delete for vm %s with UUID %s", vmName, vmUUID)) - } else { - log.V(1).Info(fmt.Sprintf("no task UUID found on VM %s. Starting delete.", *vm.Spec.Name)) - } + if taskInProgress { + log.Info(fmt.Sprintf("VM %s task with UUID %s still in progress. Requeuing", vmName, vmUUID)) + return reconcile.Result{RequeueAfter: 5 * time.Second}, nil + } + log.V(1).Info(fmt.Sprintf("No running tasks anymore... Initiating delete for vm %s with UUID %s", vmName, vmUUID)) + } else { + log.V(1).Info(fmt.Sprintf("no task UUID found on VM %s. Starting delete.", *vm.Spec.Name)) + } - if rctx.NutanixClientV4 != nil { - if err := detachVolumeGroupsFromVM(ctx, rctx.NutanixClientV4, vmUUID); err != nil { - errorMsg := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %v", vmName, vmUUID, err) - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.VolumeGroupDetachFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - log.Error(errorMsg, "failed to detach volume groups", "cluster", rctx.NutanixCluster.Name) - return reconcile.Result{}, err - } + var vgDetachNeeded bool + if vm.Spec.Resources != nil && vm.Spec.Resources.DiskList != nil { + for _, disk := range vm.Spec.Resources.DiskList { + if disk.VolumeGroupReference != nil { + vgDetachNeeded = true + break } + } + } - // Delete the VM since the VM was found (err was nil) - deleteTaskUUID, err := DeleteVM(ctx, v3Client, vmName, vmUUID) + if vgDetachNeeded { + createV4Client, err := isPrismCentralV4Compatible(ctx, v3Client) + if err != nil { + log.Info("error occurred while checking compatibility for Prism Central v4 APIs", "error", err.Error()) + } + + if createV4Client { + log.Info("Creating Prism Central v4 client for cluster", "cluster", rctx.NutanixCluster.Name) + v4Client, err := getPrismCentralV4ClientForCluster(ctx, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer) if err != nil { - errorMsg := fmt.Errorf("failed to delete VM %s with UUID %s: %v", vmName, vmUUID, err) - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - log.Error(errorMsg, "failed to delete VM") + log.Error(err, "error occurred while fetching Prism Central v4 client") + return reconcile.Result{}, err + } + + if err := detachVolumeGroupsFromVM(ctx, v4Client, vmUUID); err != nil { + errorMsg := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %v", vmName, vmUUID, err) + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.VolumeGroupDetachFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) + log.Error(errorMsg, "failed to detach volume groups", "cluster", rctx.NutanixCluster.Name) return reconcile.Result{}, err } - log.Info(fmt.Sprintf("Deletion task with UUID %s received for vm %s with UUID %s. Requeueing", deleteTaskUUID, vmName, vmUUID)) - return reconcile.Result{RequeueAfter: 5 * time.Second}, nil } } - // Remove the finalizer from the NutanixMachine object - log.Info(fmt.Sprintf("Removing finalizers for VM %s during delete reconciliation", vmName)) - ctrlutil.RemoveFinalizer(rctx.NutanixMachine, infrav1.NutanixMachineFinalizer) - - return reconcile.Result{}, nil + // Delete the VM since the VM was found (err was nil) + deleteTaskUUID, err := DeleteVM(ctx, v3Client, vmName, vmUUID) + if err != nil { + errorMsg := fmt.Errorf("failed to delete VM %s with UUID %s: %v", vmName, vmUUID, err) + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) + log.Error(errorMsg, "failed to delete VM") + return reconcile.Result{}, err + } + log.Info(fmt.Sprintf("Deletion task with UUID %s received for vm %s with UUID %s. Requeueing", deleteTaskUUID, vmName, vmUUID)) + return reconcile.Result{RequeueAfter: 5 * time.Second}, nil } func (r *NutanixMachineReconciler) reconcileNormal(rctx *nctx.MachineContext) (reconcile.Result, error) { diff --git a/pkg/context/context.go b/pkg/context/context.go index a07005b537..a3cea520a7 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -23,7 +23,6 @@ import ( "github.com/nutanix-cloud-native/prism-go-client/utils" prismclientv3 "github.com/nutanix-cloud-native/prism-go-client/v3" - prismclientv4 "github.com/nutanix-cloud-native/prism-go-client/v4" capiv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" capierrors "sigs.k8s.io/cluster-api/errors" @@ -40,9 +39,8 @@ var ( // ClusterContext is a context used with a NutanixCluster reconciler type ClusterContext struct { - Context context.Context - NutanixClient *prismclientv3.Client - NutanixClientV4 *prismclientv4.Client + Context context.Context + NutanixClient *prismclientv3.Client Cluster *capiv1.Cluster NutanixCluster *infrav1.NutanixCluster @@ -50,9 +48,8 @@ type ClusterContext struct { // MachineContext is a context used with a NutanixMachine reconciler type MachineContext struct { - Context context.Context - NutanixClient *prismclientv3.Client - NutanixClientV4 *prismclientv4.Client + Context context.Context + NutanixClient *prismclientv3.Client Cluster *capiv1.Cluster Machine *capiv1.Machine From 5cecf9d7ae0d50647588a560ed3d7bac8d469f08 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Tue, 30 Jul 2024 20:31:21 +0200 Subject: [PATCH 2/6] address review comments --- controllers/nutanixmachine_controller.go | 61 +++++++++++++----------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/controllers/nutanixmachine_controller.go b/controllers/nutanixmachine_controller.go index af9e4021f1..ce56c748a5 100644 --- a/controllers/nutanixmachine_controller.go +++ b/controllers/nutanixmachine_controller.go @@ -314,26 +314,23 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r // Check if VMUUID is absent if vmUUID == "" { - log.Info(fmt.Sprintf("VMUUID was not found in spec for VM %s. Skipping delete", vmName)) + log.Info(fmt.Sprintf("VM UUID was not found in spec for VM %s. Skipping delete", vmName)) log.Info(fmt.Sprintf("Removing finalizers for VM %s during delete reconciliation", vmName)) ctrlutil.RemoveFinalizer(rctx.NutanixMachine, infrav1.NutanixMachineFinalizer) return reconcile.Result{}, nil } - // Search for VM by UUID vm, err := FindVMByUUID(ctx, v3Client, vmUUID) - // Error while finding VM if err != nil { - errorMsg := fmt.Errorf("error finding vm %s with uuid %s: %v", vmName, vmUUID, err) - log.Error(errorMsg, "error finding vm") + errorMsg := fmt.Errorf("error finding VM %s with UUID %s: %v", vmName, vmUUID, err) + log.Error(errorMsg, "error finding VM") conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) return reconcile.Result{}, errorMsg } - // Vm not found if vm == nil { - log.Info(fmt.Sprintf("no vm found with UUID %s ... Already deleted? Skipping delete", vmUUID)) - log.Info(fmt.Sprintf("Removing finalizers for VM %s during delete reconciliation", vmName)) + log.Info(fmt.Sprintf("no VM found with UUID %s: assuming it is already deleted; skipping delete", vmUUID)) + log.Info(fmt.Sprintf("removing finalizers for VM %s during delete reconciliation", vmName)) ctrlutil.RemoveFinalizer(rctx.NutanixMachine, infrav1.NutanixMachineFinalizer) return reconcile.Result{}, nil } @@ -350,7 +347,7 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r log.V(1).Info(fmt.Sprintf("VM %s with UUID %s was found.", *vm.Spec.Name, vmUUID)) lastTaskUUID, err := GetTaskUUIDFromVM(vm) if err != nil { - errorMsg := fmt.Errorf("error occurred fetching task UUID from vm: %v", err) + errorMsg := fmt.Errorf("error occurred fetching task UUID from VM: %v", err) log.Error(errorMsg, "error fetching task UUID") conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) return reconcile.Result{}, errorMsg @@ -366,7 +363,7 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r log.Info(fmt.Sprintf("VM %s task with UUID %s still in progress. Requeuing", vmName, vmUUID)) return reconcile.Result{RequeueAfter: 5 * time.Second}, nil } - log.V(1).Info(fmt.Sprintf("No running tasks anymore... Initiating delete for vm %s with UUID %s", vmName, vmUUID)) + log.V(1).Info(fmt.Sprintf("no running tasks anymore... Initiating delete for VM %s with UUID %s", vmName, vmUUID)) } else { log.V(1).Info(fmt.Sprintf("no task UUID found on VM %s. Starting delete.", *vm.Spec.Name)) } @@ -382,25 +379,8 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r } if vgDetachNeeded { - createV4Client, err := isPrismCentralV4Compatible(ctx, v3Client) - if err != nil { - log.Info("error occurred while checking compatibility for Prism Central v4 APIs", "error", err.Error()) - } - - if createV4Client { - log.Info("Creating Prism Central v4 client for cluster", "cluster", rctx.NutanixCluster.Name) - v4Client, err := getPrismCentralV4ClientForCluster(ctx, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer) - if err != nil { - log.Error(err, "error occurred while fetching Prism Central v4 client") - return reconcile.Result{}, err - } - - if err := detachVolumeGroupsFromVM(ctx, v4Client, vmUUID); err != nil { - errorMsg := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %v", vmName, vmUUID, err) - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.VolumeGroupDetachFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - log.Error(errorMsg, "failed to detach volume groups", "cluster", rctx.NutanixCluster.Name) - return reconcile.Result{}, err - } + if err := r.detachVolumeGroups(rctx, vmUUID); err != nil { + return reconcile.Result{}, err } } @@ -416,6 +396,29 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r return reconcile.Result{RequeueAfter: 5 * time.Second}, nil } +func (r *NutanixMachineReconciler) detachVolumeGroups(rctx *nctx.MachineContext, vmUUID string) error { + createV4Client, err := isPrismCentralV4Compatible(rctx.Context, rctx.NutanixClient) + if err != nil { + err := fmt.Errorf("error occurred while checking compatibility for Prism Central v4 APIs: %w", err) + return err + } + + if createV4Client { + v4Client, err := getPrismCentralV4ClientForCluster(rctx.Context, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer) + if err != nil { + err := fmt.Errorf("error occurred while fetching Prism Central v4 client: %w", err) + return err + } + + if err := detachVolumeGroupsFromVM(rctx.Context, v4Client, vmUUID); err != nil { + err := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %w", rctx.Machine.Name, vmUUID, err) + return err + } + } + + return nil +} + func (r *NutanixMachineReconciler) reconcileNormal(rctx *nctx.MachineContext) (reconcile.Result, error) { log := ctrl.LoggerFrom(rctx.Context) if rctx.NutanixMachine.Status.FailureReason != nil || rctx.NutanixMachine.Status.FailureMessage != nil { From 452336c102b574fb229262e76228954d0dbf9579 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Wed, 31 Jul 2024 02:24:10 +0200 Subject: [PATCH 3/6] address more review comments --- controllers/nutanixmachine_controller.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/controllers/nutanixmachine_controller.go b/controllers/nutanixmachine_controller.go index ce56c748a5..4415581a43 100644 --- a/controllers/nutanixmachine_controller.go +++ b/controllers/nutanixmachine_controller.go @@ -403,17 +403,17 @@ func (r *NutanixMachineReconciler) detachVolumeGroups(rctx *nctx.MachineContext, return err } - if createV4Client { - v4Client, err := getPrismCentralV4ClientForCluster(rctx.Context, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer) - if err != nil { - err := fmt.Errorf("error occurred while fetching Prism Central v4 client: %w", err) - return err - } + if !createV4Client { + return nil + } - if err := detachVolumeGroupsFromVM(rctx.Context, v4Client, vmUUID); err != nil { - err := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %w", rctx.Machine.Name, vmUUID, err) - return err - } + v4Client, err := getPrismCentralV4ClientForCluster(rctx.Context, rctx.NutanixCluster, r.SecretInformer, r.ConfigMapInformer) + if err != nil { + return fmt.Errorf("error occurred while fetching Prism Central v4 client: %w", err) + } + + if err := detachVolumeGroupsFromVM(rctx.Context, v4Client, vmUUID); err != nil { + return fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %w", rctx.Machine.Name, vmUUID, err) } return nil From 98651a800b14a1f19b0392e50180402563ac893d Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Wed, 31 Jul 2024 13:15:00 +0200 Subject: [PATCH 4/6] Mark condition on detach or delete error --- controllers/nutanixmachine_controller.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/controllers/nutanixmachine_controller.go b/controllers/nutanixmachine_controller.go index 4415581a43..0834d1ea42 100644 --- a/controllers/nutanixmachine_controller.go +++ b/controllers/nutanixmachine_controller.go @@ -380,6 +380,10 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r if vgDetachNeeded { if err := r.detachVolumeGroups(rctx, vmUUID); err != nil { + err := fmt.Errorf("failed to detach volume groups from VM %s with UUID %s: %v", vmName, vmUUID, err) + log.Error(err, "failed to detach volume groups from VM") + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.VolumeGroupDetachFailed, capiv1.ConditionSeverityWarning, err.Error()) + return reconcile.Result{}, err } } @@ -387,9 +391,11 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r // Delete the VM since the VM was found (err was nil) deleteTaskUUID, err := DeleteVM(ctx, v3Client, vmName, vmUUID) if err != nil { - errorMsg := fmt.Errorf("failed to delete VM %s with UUID %s: %v", vmName, vmUUID, err) - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, errorMsg.Error()) - log.Error(errorMsg, "failed to delete VM") + err := fmt.Errorf("failed to delete VM %s with UUID %s: %v", vmName, vmUUID, err) + log.Error(err, "failed to delete VM") + + conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, err.Error()) + return reconcile.Result{}, err } log.Info(fmt.Sprintf("Deletion task with UUID %s received for vm %s with UUID %s. Requeueing", deleteTaskUUID, vmName, vmUUID)) @@ -399,8 +405,7 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r func (r *NutanixMachineReconciler) detachVolumeGroups(rctx *nctx.MachineContext, vmUUID string) error { createV4Client, err := isPrismCentralV4Compatible(rctx.Context, rctx.NutanixClient) if err != nil { - err := fmt.Errorf("error occurred while checking compatibility for Prism Central v4 APIs: %w", err) - return err + return fmt.Errorf("error occurred while checking compatibility for Prism Central v4 APIs: %w", err) } if !createV4Client { From a586a78827788319e8494bc6ebcebed8602bcf96 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Wed, 31 Jul 2024 15:54:14 +0200 Subject: [PATCH 5/6] Add some unit tests --- Makefile | 1 + controllers/nutanixmachine_controller_test.go | 85 + mocks/nutanix/v3.go | 1693 +++++++++++++++++ 3 files changed, 1779 insertions(+) create mode 100644 mocks/nutanix/v3.go diff --git a/Makefile b/Makefile index eb82c57a8a..7479e1fa05 100644 --- a/Makefile +++ b/Makefile @@ -319,6 +319,7 @@ mocks: ## Generate mocks for the project mockgen -destination=mocks/k8sclient/informer.go -package=mockk8sclient k8s.io/client-go/informers/core/v1 ConfigMapInformer,SecretInformer mockgen -destination=mocks/k8sclient/lister.go -package=mockk8sclient k8s.io/client-go/listers/core/v1 SecretLister,SecretNamespaceLister mockgen -destination=mocks/k8sapimachinery/interfaces.go -package=mockmeta k8s.io/apimachinery/pkg/api/meta RESTMapper,RESTScope + mockgen -destination=mocks/nutanix/v3.go -package=mocknutanixv3 github.com/nutanix-cloud-native/prism-go-client/v3 Service GOTESTPKGS = $(shell go list ./... | grep -v /mocks | grep -v /templates) diff --git a/controllers/nutanixmachine_controller_test.go b/controllers/nutanixmachine_controller_test.go index a58437dbca..f57baa2ba6 100644 --- a/controllers/nutanixmachine_controller_test.go +++ b/controllers/nutanixmachine_controller_test.go @@ -19,10 +19,13 @@ package controllers import ( "context" "errors" + "k8s.io/utils/ptr" "testing" "github.com/golang/mock/gomock" credentialTypes "github.com/nutanix-cloud-native/prism-go-client/environment/credentials" + v3 "github.com/nutanix-cloud-native/prism-go-client/v3" + "github.com/nutanix-cloud-native/prism-go-client/v3/models" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/stretchr/testify/assert" @@ -39,6 +42,7 @@ import ( infrav1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" mockctlclient "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/mocks/ctlclient" mockmeta "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/mocks/k8sapimachinery" + mocknutanixv3 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/mocks/nutanix" nctx "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/pkg/context" ) @@ -108,6 +112,7 @@ func TestNutanixMachineReconciler(t *testing.T) { g.Expect(result.Requeue).To(BeFalse()) }) }) + Context("Validates machine config", func() { It("should error if no failure domain is present on machine and no subnets are passed", func() { err := reconciler.validateMachineConfig(&nctx.MachineContext{ @@ -234,6 +239,86 @@ func TestNutanixMachineReconciler(t *testing.T) { g.Expect(err).To(HaveOccurred()) }) }) + + Context("Detaches a volume group on deletion", func() { + It("should error if get prism central returns error", func() { + mockctrl := gomock.NewController(t) + mockv3Service := mocknutanixv3.NewMockService(mockctrl) + mockv3Service.EXPECT().GetPrismCentral(gomock.Any()).Return(nil, errors.New("error")) + + v3Client := &v3.Client{ + V3: mockv3Service, + } + err := reconciler.detachVolumeGroups(&nctx.MachineContext{ + NutanixClient: v3Client, + }, ntnxMachine.Status.VmUUID) + g.Expect(err).To(HaveOccurred()) + }) + + It("should error if prism central version is empty", func() { + mockctrl := gomock.NewController(t) + mockv3Service := mocknutanixv3.NewMockService(mockctrl) + mockv3Service.EXPECT().GetPrismCentral(gomock.Any()).Return(&models.PrismCentral{Resources: &models.PrismCentralResources{ + Version: ptr.To(""), + }}, nil) + + v3Client := &v3.Client{ + V3: mockv3Service, + } + err := reconciler.detachVolumeGroups(&nctx.MachineContext{ + NutanixClient: v3Client, + }, ntnxMachine.Status.VmUUID) + g.Expect(err).To(HaveOccurred()) + }) + + It("should error if prism central version value is absent", func() { + mockctrl := gomock.NewController(t) + mockv3Service := mocknutanixv3.NewMockService(mockctrl) + mockv3Service.EXPECT().GetPrismCentral(gomock.Any()).Return(&models.PrismCentral{Resources: &models.PrismCentralResources{ + Version: ptr.To("pc."), + }}, nil) + + v3Client := &v3.Client{ + V3: mockv3Service, + } + err := reconciler.detachVolumeGroups(&nctx.MachineContext{ + NutanixClient: v3Client, + }, ntnxMachine.Status.VmUUID) + g.Expect(err).To(HaveOccurred()) + }) + + It("should error if prism central version is invalid", func() { + mockctrl := gomock.NewController(t) + mockv3Service := mocknutanixv3.NewMockService(mockctrl) + mockv3Service.EXPECT().GetPrismCentral(gomock.Any()).Return(&models.PrismCentral{Resources: &models.PrismCentralResources{ + Version: ptr.To("not.a.valid.version"), + }}, nil) + + v3Client := &v3.Client{ + V3: mockv3Service, + } + err := reconciler.detachVolumeGroups(&nctx.MachineContext{ + NutanixClient: v3Client, + }, ntnxMachine.Status.VmUUID) + g.Expect(err).To(HaveOccurred()) + }) + + It("should not error if prism central is not v4 compatible", func() { + mockctrl := gomock.NewController(t) + mockv3Service := mocknutanixv3.NewMockService(mockctrl) + mockv3Service.EXPECT().GetPrismCentral(gomock.Any()).Return(&models.PrismCentral{Resources: &models.PrismCentralResources{ + Version: ptr.To("pc.2023.4.0.1"), + }}, nil) + + v3Client := &v3.Client{ + V3: mockv3Service, + } + err := reconciler.detachVolumeGroups(&nctx.MachineContext{ + NutanixClient: v3Client, + }, ntnxMachine.Status.VmUUID) + g.Expect(err).To(Not(HaveOccurred())) + }) + }) }) } diff --git a/mocks/nutanix/v3.go b/mocks/nutanix/v3.go new file mode 100644 index 0000000000..ecc198b058 --- /dev/null +++ b/mocks/nutanix/v3.go @@ -0,0 +1,1693 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/nutanix-cloud-native/prism-go-client/v3 (interfaces: Service) + +// Package mocknutanixv3 is a generated GoMock package. +package mocknutanixv3 + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + prismgoclient "github.com/nutanix-cloud-native/prism-go-client" + v3 "github.com/nutanix-cloud-native/prism-go-client/v3" + models "github.com/nutanix-cloud-native/prism-go-client/v3/models" +) + +// MockService is a mock of Service interface. +type MockService struct { + ctrl *gomock.Controller + recorder *MockServiceMockRecorder +} + +// MockServiceMockRecorder is the mock recorder for MockService. +type MockServiceMockRecorder struct { + mock *MockService +} + +// NewMockService creates a new mock instance. +func NewMockService(ctrl *gomock.Controller) *MockService { + mock := &MockService{ctrl: ctrl} + mock.recorder = &MockServiceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockService) EXPECT() *MockServiceMockRecorder { + return m.recorder +} + +// CreateAccessControlPolicy mocks base method. +func (m *MockService) CreateAccessControlPolicy(arg0 context.Context, arg1 *v3.AccessControlPolicy) (*v3.AccessControlPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateAccessControlPolicy", arg0, arg1) + ret0, _ := ret[0].(*v3.AccessControlPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateAccessControlPolicy indicates an expected call of CreateAccessControlPolicy. +func (mr *MockServiceMockRecorder) CreateAccessControlPolicy(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessControlPolicy", reflect.TypeOf((*MockService)(nil).CreateAccessControlPolicy), arg0, arg1) +} + +// CreateAddressGroup mocks base method. +func (m *MockService) CreateAddressGroup(arg0 context.Context, arg1 *v3.AddressGroupInput) (*v3.Reference, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateAddressGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.Reference) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateAddressGroup indicates an expected call of CreateAddressGroup. +func (mr *MockServiceMockRecorder) CreateAddressGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAddressGroup", reflect.TypeOf((*MockService)(nil).CreateAddressGroup), arg0, arg1) +} + +// CreateImage mocks base method. +func (m *MockService) CreateImage(arg0 context.Context, arg1 *v3.ImageIntentInput) (*v3.ImageIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateImage", arg0, arg1) + ret0, _ := ret[0].(*v3.ImageIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateImage indicates an expected call of CreateImage. +func (mr *MockServiceMockRecorder) CreateImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateImage", reflect.TypeOf((*MockService)(nil).CreateImage), arg0, arg1) +} + +// CreateNetworkSecurityRule mocks base method. +func (m *MockService) CreateNetworkSecurityRule(arg0 context.Context, arg1 *v3.NetworkSecurityRuleIntentInput) (*v3.NetworkSecurityRuleIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateNetworkSecurityRule", arg0, arg1) + ret0, _ := ret[0].(*v3.NetworkSecurityRuleIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateNetworkSecurityRule indicates an expected call of CreateNetworkSecurityRule. +func (mr *MockServiceMockRecorder) CreateNetworkSecurityRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).CreateNetworkSecurityRule), arg0, arg1) +} + +// CreateOrUpdateCategoryKey mocks base method. +func (m *MockService) CreateOrUpdateCategoryKey(arg0 context.Context, arg1 *v3.CategoryKey) (*v3.CategoryKeyStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdateCategoryKey", arg0, arg1) + ret0, _ := ret[0].(*v3.CategoryKeyStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdateCategoryKey indicates an expected call of CreateOrUpdateCategoryKey. +func (mr *MockServiceMockRecorder) CreateOrUpdateCategoryKey(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateCategoryKey", reflect.TypeOf((*MockService)(nil).CreateOrUpdateCategoryKey), arg0, arg1) +} + +// CreateOrUpdateCategoryValue mocks base method. +func (m *MockService) CreateOrUpdateCategoryValue(arg0 context.Context, arg1 string, arg2 *v3.CategoryValue) (*v3.CategoryValueStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateOrUpdateCategoryValue", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.CategoryValueStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateOrUpdateCategoryValue indicates an expected call of CreateOrUpdateCategoryValue. +func (mr *MockServiceMockRecorder) CreateOrUpdateCategoryValue(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateOrUpdateCategoryValue", reflect.TypeOf((*MockService)(nil).CreateOrUpdateCategoryValue), arg0, arg1, arg2) +} + +// CreateProject mocks base method. +func (m *MockService) CreateProject(arg0 context.Context, arg1 *v3.Project) (*v3.Project, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateProject", arg0, arg1) + ret0, _ := ret[0].(*v3.Project) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateProject indicates an expected call of CreateProject. +func (mr *MockServiceMockRecorder) CreateProject(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateProject", reflect.TypeOf((*MockService)(nil).CreateProject), arg0, arg1) +} + +// CreateProtectionRule mocks base method. +func (m *MockService) CreateProtectionRule(arg0 context.Context, arg1 *v3.ProtectionRuleInput) (*v3.ProtectionRuleResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateProtectionRule", arg0, arg1) + ret0, _ := ret[0].(*v3.ProtectionRuleResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateProtectionRule indicates an expected call of CreateProtectionRule. +func (mr *MockServiceMockRecorder) CreateProtectionRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateProtectionRule", reflect.TypeOf((*MockService)(nil).CreateProtectionRule), arg0, arg1) +} + +// CreateRecoveryPlan mocks base method. +func (m *MockService) CreateRecoveryPlan(arg0 context.Context, arg1 *v3.RecoveryPlanInput) (*v3.RecoveryPlanResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRecoveryPlan", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRecoveryPlan indicates an expected call of CreateRecoveryPlan. +func (mr *MockServiceMockRecorder) CreateRecoveryPlan(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRecoveryPlan", reflect.TypeOf((*MockService)(nil).CreateRecoveryPlan), arg0, arg1) +} + +// CreateRecoveryPlanJob mocks base method. +func (m *MockService) CreateRecoveryPlanJob(arg0 context.Context, arg1 *v3.RecoveryPlanJobIntentInput) (*v3.RecoveryPlanJobResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRecoveryPlanJob", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanJobResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRecoveryPlanJob indicates an expected call of CreateRecoveryPlanJob. +func (mr *MockServiceMockRecorder) CreateRecoveryPlanJob(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRecoveryPlanJob", reflect.TypeOf((*MockService)(nil).CreateRecoveryPlanJob), arg0, arg1) +} + +// CreateRole mocks base method. +func (m *MockService) CreateRole(arg0 context.Context, arg1 *v3.Role) (*v3.Role, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRole", arg0, arg1) + ret0, _ := ret[0].(*v3.Role) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateRole indicates an expected call of CreateRole. +func (mr *MockServiceMockRecorder) CreateRole(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRole", reflect.TypeOf((*MockService)(nil).CreateRole), arg0, arg1) +} + +// CreateServiceGroup mocks base method. +func (m *MockService) CreateServiceGroup(arg0 context.Context, arg1 *v3.ServiceGroupInput) (*v3.Reference, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateServiceGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.Reference) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateServiceGroup indicates an expected call of CreateServiceGroup. +func (mr *MockServiceMockRecorder) CreateServiceGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceGroup", reflect.TypeOf((*MockService)(nil).CreateServiceGroup), arg0, arg1) +} + +// CreateSubnet mocks base method. +func (m *MockService) CreateSubnet(arg0 context.Context, arg1 *v3.SubnetIntentInput) (*v3.SubnetIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSubnet", arg0, arg1) + ret0, _ := ret[0].(*v3.SubnetIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateSubnet indicates an expected call of CreateSubnet. +func (mr *MockServiceMockRecorder) CreateSubnet(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSubnet", reflect.TypeOf((*MockService)(nil).CreateSubnet), arg0, arg1) +} + +// CreateUser mocks base method. +func (m *MockService) CreateUser(arg0 context.Context, arg1 *v3.UserIntentInput) (*v3.UserIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateUser", arg0, arg1) + ret0, _ := ret[0].(*v3.UserIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateUser indicates an expected call of CreateUser. +func (mr *MockServiceMockRecorder) CreateUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUser", reflect.TypeOf((*MockService)(nil).CreateUser), arg0, arg1) +} + +// CreateVM mocks base method. +func (m *MockService) CreateVM(arg0 context.Context, arg1 *v3.VMIntentInput) (*v3.VMIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateVM", arg0, arg1) + ret0, _ := ret[0].(*v3.VMIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateVM indicates an expected call of CreateVM. +func (mr *MockServiceMockRecorder) CreateVM(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVM", reflect.TypeOf((*MockService)(nil).CreateVM), arg0, arg1) +} + +// CreateVolumeGroup mocks base method. +func (m *MockService) CreateVolumeGroup(arg0 context.Context, arg1 *v3.VolumeGroupInput) (*v3.VolumeGroupResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateVolumeGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.VolumeGroupResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateVolumeGroup indicates an expected call of CreateVolumeGroup. +func (mr *MockServiceMockRecorder) CreateVolumeGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVolumeGroup", reflect.TypeOf((*MockService)(nil).CreateVolumeGroup), arg0, arg1) +} + +// DeleteAccessControlPolicy mocks base method. +func (m *MockService) DeleteAccessControlPolicy(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAccessControlPolicy", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteAccessControlPolicy indicates an expected call of DeleteAccessControlPolicy. +func (mr *MockServiceMockRecorder) DeleteAccessControlPolicy(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAccessControlPolicy", reflect.TypeOf((*MockService)(nil).DeleteAccessControlPolicy), arg0, arg1) +} + +// DeleteAddressGroup mocks base method. +func (m *MockService) DeleteAddressGroup(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAddressGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAddressGroup indicates an expected call of DeleteAddressGroup. +func (mr *MockServiceMockRecorder) DeleteAddressGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAddressGroup", reflect.TypeOf((*MockService)(nil).DeleteAddressGroup), arg0, arg1) +} + +// DeleteCategoryKey mocks base method. +func (m *MockService) DeleteCategoryKey(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteCategoryKey", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteCategoryKey indicates an expected call of DeleteCategoryKey. +func (mr *MockServiceMockRecorder) DeleteCategoryKey(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCategoryKey", reflect.TypeOf((*MockService)(nil).DeleteCategoryKey), arg0, arg1) +} + +// DeleteCategoryValue mocks base method. +func (m *MockService) DeleteCategoryValue(arg0 context.Context, arg1, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteCategoryValue", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteCategoryValue indicates an expected call of DeleteCategoryValue. +func (mr *MockServiceMockRecorder) DeleteCategoryValue(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteCategoryValue", reflect.TypeOf((*MockService)(nil).DeleteCategoryValue), arg0, arg1, arg2) +} + +// DeleteImage mocks base method. +func (m *MockService) DeleteImage(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteImage", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteImage indicates an expected call of DeleteImage. +func (mr *MockServiceMockRecorder) DeleteImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteImage", reflect.TypeOf((*MockService)(nil).DeleteImage), arg0, arg1) +} + +// DeleteNetworkSecurityRule mocks base method. +func (m *MockService) DeleteNetworkSecurityRule(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteNetworkSecurityRule", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteNetworkSecurityRule indicates an expected call of DeleteNetworkSecurityRule. +func (mr *MockServiceMockRecorder) DeleteNetworkSecurityRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).DeleteNetworkSecurityRule), arg0, arg1) +} + +// DeleteProject mocks base method. +func (m *MockService) DeleteProject(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteProject", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteProject indicates an expected call of DeleteProject. +func (mr *MockServiceMockRecorder) DeleteProject(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteProject", reflect.TypeOf((*MockService)(nil).DeleteProject), arg0, arg1) +} + +// DeleteProtectionRule mocks base method. +func (m *MockService) DeleteProtectionRule(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteProtectionRule", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteProtectionRule indicates an expected call of DeleteProtectionRule. +func (mr *MockServiceMockRecorder) DeleteProtectionRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteProtectionRule", reflect.TypeOf((*MockService)(nil).DeleteProtectionRule), arg0, arg1) +} + +// DeleteRecoveryPlan mocks base method. +func (m *MockService) DeleteRecoveryPlan(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRecoveryPlan", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteRecoveryPlan indicates an expected call of DeleteRecoveryPlan. +func (mr *MockServiceMockRecorder) DeleteRecoveryPlan(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRecoveryPlan", reflect.TypeOf((*MockService)(nil).DeleteRecoveryPlan), arg0, arg1) +} + +// DeleteRecoveryPlanJob mocks base method. +func (m *MockService) DeleteRecoveryPlanJob(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRecoveryPlanJob", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRecoveryPlanJob indicates an expected call of DeleteRecoveryPlanJob. +func (mr *MockServiceMockRecorder) DeleteRecoveryPlanJob(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRecoveryPlanJob", reflect.TypeOf((*MockService)(nil).DeleteRecoveryPlanJob), arg0, arg1) +} + +// DeleteRole mocks base method. +func (m *MockService) DeleteRole(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRole", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteRole indicates an expected call of DeleteRole. +func (mr *MockServiceMockRecorder) DeleteRole(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRole", reflect.TypeOf((*MockService)(nil).DeleteRole), arg0, arg1) +} + +// DeleteServiceGroup mocks base method. +func (m *MockService) DeleteServiceGroup(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteServiceGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteServiceGroup indicates an expected call of DeleteServiceGroup. +func (mr *MockServiceMockRecorder) DeleteServiceGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceGroup", reflect.TypeOf((*MockService)(nil).DeleteServiceGroup), arg0, arg1) +} + +// DeleteSubnet mocks base method. +func (m *MockService) DeleteSubnet(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteSubnet", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteSubnet indicates an expected call of DeleteSubnet. +func (mr *MockServiceMockRecorder) DeleteSubnet(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSubnet", reflect.TypeOf((*MockService)(nil).DeleteSubnet), arg0, arg1) +} + +// DeleteUser mocks base method. +func (m *MockService) DeleteUser(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteUser", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteUser indicates an expected call of DeleteUser. +func (mr *MockServiceMockRecorder) DeleteUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteUser", reflect.TypeOf((*MockService)(nil).DeleteUser), arg0, arg1) +} + +// DeleteVM mocks base method. +func (m *MockService) DeleteVM(arg0 context.Context, arg1 string) (*v3.DeleteResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteVM", arg0, arg1) + ret0, _ := ret[0].(*v3.DeleteResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteVM indicates an expected call of DeleteVM. +func (mr *MockServiceMockRecorder) DeleteVM(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVM", reflect.TypeOf((*MockService)(nil).DeleteVM), arg0, arg1) +} + +// DeleteVolumeGroup mocks base method. +func (m *MockService) DeleteVolumeGroup(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteVolumeGroup", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteVolumeGroup indicates an expected call of DeleteVolumeGroup. +func (mr *MockServiceMockRecorder) DeleteVolumeGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVolumeGroup", reflect.TypeOf((*MockService)(nil).DeleteVolumeGroup), arg0, arg1) +} + +// GetAccessControlPolicy mocks base method. +func (m *MockService) GetAccessControlPolicy(arg0 context.Context, arg1 string) (*v3.AccessControlPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccessControlPolicy", arg0, arg1) + ret0, _ := ret[0].(*v3.AccessControlPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAccessControlPolicy indicates an expected call of GetAccessControlPolicy. +func (mr *MockServiceMockRecorder) GetAccessControlPolicy(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessControlPolicy", reflect.TypeOf((*MockService)(nil).GetAccessControlPolicy), arg0, arg1) +} + +// GetAddressGroup mocks base method. +func (m *MockService) GetAddressGroup(arg0 context.Context, arg1 string) (*v3.AddressGroupResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAddressGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.AddressGroupResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAddressGroup indicates an expected call of GetAddressGroup. +func (mr *MockServiceMockRecorder) GetAddressGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddressGroup", reflect.TypeOf((*MockService)(nil).GetAddressGroup), arg0, arg1) +} + +// GetAvailabilityZone mocks base method. +func (m *MockService) GetAvailabilityZone(arg0 context.Context, arg1 string) (*v3.AvailabilityZoneIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAvailabilityZone", arg0, arg1) + ret0, _ := ret[0].(*v3.AvailabilityZoneIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAvailabilityZone indicates an expected call of GetAvailabilityZone. +func (mr *MockServiceMockRecorder) GetAvailabilityZone(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAvailabilityZone", reflect.TypeOf((*MockService)(nil).GetAvailabilityZone), arg0, arg1) +} + +// GetCategoryKey mocks base method. +func (m *MockService) GetCategoryKey(arg0 context.Context, arg1 string) (*v3.CategoryKeyStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCategoryKey", arg0, arg1) + ret0, _ := ret[0].(*v3.CategoryKeyStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCategoryKey indicates an expected call of GetCategoryKey. +func (mr *MockServiceMockRecorder) GetCategoryKey(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCategoryKey", reflect.TypeOf((*MockService)(nil).GetCategoryKey), arg0, arg1) +} + +// GetCategoryQuery mocks base method. +func (m *MockService) GetCategoryQuery(arg0 context.Context, arg1 *v3.CategoryQueryInput) (*v3.CategoryQueryResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCategoryQuery", arg0, arg1) + ret0, _ := ret[0].(*v3.CategoryQueryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCategoryQuery indicates an expected call of GetCategoryQuery. +func (mr *MockServiceMockRecorder) GetCategoryQuery(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCategoryQuery", reflect.TypeOf((*MockService)(nil).GetCategoryQuery), arg0, arg1) +} + +// GetCategoryValue mocks base method. +func (m *MockService) GetCategoryValue(arg0 context.Context, arg1, arg2 string) (*v3.CategoryValueStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCategoryValue", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.CategoryValueStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCategoryValue indicates an expected call of GetCategoryValue. +func (mr *MockServiceMockRecorder) GetCategoryValue(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCategoryValue", reflect.TypeOf((*MockService)(nil).GetCategoryValue), arg0, arg1, arg2) +} + +// GetCluster mocks base method. +func (m *MockService) GetCluster(arg0 context.Context, arg1 string) (*v3.ClusterIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCluster", arg0, arg1) + ret0, _ := ret[0].(*v3.ClusterIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCluster indicates an expected call of GetCluster. +func (mr *MockServiceMockRecorder) GetCluster(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCluster", reflect.TypeOf((*MockService)(nil).GetCluster), arg0, arg1) +} + +// GetCurrentLoggedInUser mocks base method. +func (m *MockService) GetCurrentLoggedInUser(arg0 context.Context) (*v3.UserIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetCurrentLoggedInUser", arg0) + ret0, _ := ret[0].(*v3.UserIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetCurrentLoggedInUser indicates an expected call of GetCurrentLoggedInUser. +func (mr *MockServiceMockRecorder) GetCurrentLoggedInUser(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentLoggedInUser", reflect.TypeOf((*MockService)(nil).GetCurrentLoggedInUser), arg0) +} + +// GetHost mocks base method. +func (m *MockService) GetHost(arg0 context.Context, arg1 string) (*v3.HostResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetHost", arg0, arg1) + ret0, _ := ret[0].(*v3.HostResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHost indicates an expected call of GetHost. +func (mr *MockServiceMockRecorder) GetHost(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHost", reflect.TypeOf((*MockService)(nil).GetHost), arg0, arg1) +} + +// GetImage mocks base method. +func (m *MockService) GetImage(arg0 context.Context, arg1 string) (*v3.ImageIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetImage", arg0, arg1) + ret0, _ := ret[0].(*v3.ImageIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetImage indicates an expected call of GetImage. +func (mr *MockServiceMockRecorder) GetImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetImage", reflect.TypeOf((*MockService)(nil).GetImage), arg0, arg1) +} + +// GetNetworkSecurityRule mocks base method. +func (m *MockService) GetNetworkSecurityRule(arg0 context.Context, arg1 string) (*v3.NetworkSecurityRuleIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetNetworkSecurityRule", arg0, arg1) + ret0, _ := ret[0].(*v3.NetworkSecurityRuleIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetNetworkSecurityRule indicates an expected call of GetNetworkSecurityRule. +func (mr *MockServiceMockRecorder) GetNetworkSecurityRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).GetNetworkSecurityRule), arg0, arg1) +} + +// GetPermission mocks base method. +func (m *MockService) GetPermission(arg0 context.Context, arg1 string) (*v3.PermissionIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPermission", arg0, arg1) + ret0, _ := ret[0].(*v3.PermissionIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPermission indicates an expected call of GetPermission. +func (mr *MockServiceMockRecorder) GetPermission(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPermission", reflect.TypeOf((*MockService)(nil).GetPermission), arg0, arg1) +} + +// GetPrismCentral mocks base method. +func (m *MockService) GetPrismCentral(arg0 context.Context) (*models.PrismCentral, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPrismCentral", arg0) + ret0, _ := ret[0].(*models.PrismCentral) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPrismCentral indicates an expected call of GetPrismCentral. +func (mr *MockServiceMockRecorder) GetPrismCentral(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPrismCentral", reflect.TypeOf((*MockService)(nil).GetPrismCentral), arg0) +} + +// GetProject mocks base method. +func (m *MockService) GetProject(arg0 context.Context, arg1 string) (*v3.Project, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProject", arg0, arg1) + ret0, _ := ret[0].(*v3.Project) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProject indicates an expected call of GetProject. +func (mr *MockServiceMockRecorder) GetProject(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProject", reflect.TypeOf((*MockService)(nil).GetProject), arg0, arg1) +} + +// GetProtectionRule mocks base method. +func (m *MockService) GetProtectionRule(arg0 context.Context, arg1 string) (*v3.ProtectionRuleResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProtectionRule", arg0, arg1) + ret0, _ := ret[0].(*v3.ProtectionRuleResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProtectionRule indicates an expected call of GetProtectionRule. +func (mr *MockServiceMockRecorder) GetProtectionRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProtectionRule", reflect.TypeOf((*MockService)(nil).GetProtectionRule), arg0, arg1) +} + +// GetRecoveryPlan mocks base method. +func (m *MockService) GetRecoveryPlan(arg0 context.Context, arg1 string) (*v3.RecoveryPlanResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecoveryPlan", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecoveryPlan indicates an expected call of GetRecoveryPlan. +func (mr *MockServiceMockRecorder) GetRecoveryPlan(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecoveryPlan", reflect.TypeOf((*MockService)(nil).GetRecoveryPlan), arg0, arg1) +} + +// GetRecoveryPlanJob mocks base method. +func (m *MockService) GetRecoveryPlanJob(arg0 context.Context, arg1 string) (*v3.RecoveryPlanJobIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecoveryPlanJob", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanJobIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecoveryPlanJob indicates an expected call of GetRecoveryPlanJob. +func (mr *MockServiceMockRecorder) GetRecoveryPlanJob(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecoveryPlanJob", reflect.TypeOf((*MockService)(nil).GetRecoveryPlanJob), arg0, arg1) +} + +// GetRecoveryPlanJobStatus mocks base method. +func (m *MockService) GetRecoveryPlanJobStatus(arg0 context.Context, arg1, arg2 string) (*v3.RecoveryPlanJobExecutionStatus, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRecoveryPlanJobStatus", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.RecoveryPlanJobExecutionStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRecoveryPlanJobStatus indicates an expected call of GetRecoveryPlanJobStatus. +func (mr *MockServiceMockRecorder) GetRecoveryPlanJobStatus(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRecoveryPlanJobStatus", reflect.TypeOf((*MockService)(nil).GetRecoveryPlanJobStatus), arg0, arg1, arg2) +} + +// GetRole mocks base method. +func (m *MockService) GetRole(arg0 context.Context, arg1 string) (*v3.Role, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRole", arg0, arg1) + ret0, _ := ret[0].(*v3.Role) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRole indicates an expected call of GetRole. +func (mr *MockServiceMockRecorder) GetRole(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRole", reflect.TypeOf((*MockService)(nil).GetRole), arg0, arg1) +} + +// GetServiceGroup mocks base method. +func (m *MockService) GetServiceGroup(arg0 context.Context, arg1 string) (*v3.ServiceGroupResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetServiceGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.ServiceGroupResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetServiceGroup indicates an expected call of GetServiceGroup. +func (mr *MockServiceMockRecorder) GetServiceGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceGroup", reflect.TypeOf((*MockService)(nil).GetServiceGroup), arg0, arg1) +} + +// GetSubnet mocks base method. +func (m *MockService) GetSubnet(arg0 context.Context, arg1 string) (*v3.SubnetIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSubnet", arg0, arg1) + ret0, _ := ret[0].(*v3.SubnetIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSubnet indicates an expected call of GetSubnet. +func (mr *MockServiceMockRecorder) GetSubnet(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubnet", reflect.TypeOf((*MockService)(nil).GetSubnet), arg0, arg1) +} + +// GetTask mocks base method. +func (m *MockService) GetTask(arg0 context.Context, arg1 string) (*v3.TasksResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTask", arg0, arg1) + ret0, _ := ret[0].(*v3.TasksResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTask indicates an expected call of GetTask. +func (mr *MockServiceMockRecorder) GetTask(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTask", reflect.TypeOf((*MockService)(nil).GetTask), arg0, arg1) +} + +// GetUser mocks base method. +func (m *MockService) GetUser(arg0 context.Context, arg1 string) (*v3.UserIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUser", arg0, arg1) + ret0, _ := ret[0].(*v3.UserIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUser indicates an expected call of GetUser. +func (mr *MockServiceMockRecorder) GetUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUser", reflect.TypeOf((*MockService)(nil).GetUser), arg0, arg1) +} + +// GetUserGroup mocks base method. +func (m *MockService) GetUserGroup(arg0 context.Context, arg1 string) (*v3.UserGroupIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetUserGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.UserGroupIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetUserGroup indicates an expected call of GetUserGroup. +func (mr *MockServiceMockRecorder) GetUserGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserGroup", reflect.TypeOf((*MockService)(nil).GetUserGroup), arg0, arg1) +} + +// GetVM mocks base method. +func (m *MockService) GetVM(arg0 context.Context, arg1 string) (*v3.VMIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVM", arg0, arg1) + ret0, _ := ret[0].(*v3.VMIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVM indicates an expected call of GetVM. +func (mr *MockServiceMockRecorder) GetVM(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVM", reflect.TypeOf((*MockService)(nil).GetVM), arg0, arg1) +} + +// GetVolumeGroup mocks base method. +func (m *MockService) GetVolumeGroup(arg0 context.Context, arg1 string) (*v3.VolumeGroupResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVolumeGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.VolumeGroupResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVolumeGroup indicates an expected call of GetVolumeGroup. +func (mr *MockServiceMockRecorder) GetVolumeGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVolumeGroup", reflect.TypeOf((*MockService)(nil).GetVolumeGroup), arg0, arg1) +} + +// GroupsGetEntities mocks base method. +func (m *MockService) GroupsGetEntities(arg0 context.Context, arg1 *v3.GroupsGetEntitiesRequest) (*v3.GroupsGetEntitiesResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GroupsGetEntities", arg0, arg1) + ret0, _ := ret[0].(*v3.GroupsGetEntitiesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GroupsGetEntities indicates an expected call of GroupsGetEntities. +func (mr *MockServiceMockRecorder) GroupsGetEntities(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GroupsGetEntities", reflect.TypeOf((*MockService)(nil).GroupsGetEntities), arg0, arg1) +} + +// ListAccessControlPolicy mocks base method. +func (m *MockService) ListAccessControlPolicy(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.AccessControlPolicyListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAccessControlPolicy", arg0, arg1) + ret0, _ := ret[0].(*v3.AccessControlPolicyListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAccessControlPolicy indicates an expected call of ListAccessControlPolicy. +func (mr *MockServiceMockRecorder) ListAccessControlPolicy(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAccessControlPolicy", reflect.TypeOf((*MockService)(nil).ListAccessControlPolicy), arg0, arg1) +} + +// ListAddressGroups mocks base method. +func (m *MockService) ListAddressGroups(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.AddressGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAddressGroups", arg0, arg1) + ret0, _ := ret[0].(*v3.AddressGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAddressGroups indicates an expected call of ListAddressGroups. +func (mr *MockServiceMockRecorder) ListAddressGroups(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAddressGroups", reflect.TypeOf((*MockService)(nil).ListAddressGroups), arg0, arg1) +} + +// ListAllAccessControlPolicy mocks base method. +func (m *MockService) ListAllAccessControlPolicy(arg0 context.Context, arg1 string) (*v3.AccessControlPolicyListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllAccessControlPolicy", arg0, arg1) + ret0, _ := ret[0].(*v3.AccessControlPolicyListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllAccessControlPolicy indicates an expected call of ListAllAccessControlPolicy. +func (mr *MockServiceMockRecorder) ListAllAccessControlPolicy(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllAccessControlPolicy", reflect.TypeOf((*MockService)(nil).ListAllAccessControlPolicy), arg0, arg1) +} + +// ListAllAddressGroups mocks base method. +func (m *MockService) ListAllAddressGroups(arg0 context.Context, arg1 string) (*v3.AddressGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllAddressGroups", arg0, arg1) + ret0, _ := ret[0].(*v3.AddressGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllAddressGroups indicates an expected call of ListAllAddressGroups. +func (mr *MockServiceMockRecorder) ListAllAddressGroups(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllAddressGroups", reflect.TypeOf((*MockService)(nil).ListAllAddressGroups), arg0, arg1) +} + +// ListAllCategoryValues mocks base method. +func (m *MockService) ListAllCategoryValues(arg0 context.Context, arg1, arg2 string) (*v3.CategoryValueListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllCategoryValues", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.CategoryValueListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllCategoryValues indicates an expected call of ListAllCategoryValues. +func (mr *MockServiceMockRecorder) ListAllCategoryValues(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllCategoryValues", reflect.TypeOf((*MockService)(nil).ListAllCategoryValues), arg0, arg1, arg2) +} + +// ListAllCluster mocks base method. +func (m *MockService) ListAllCluster(arg0 context.Context, arg1 string) (*v3.ClusterListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllCluster", arg0, arg1) + ret0, _ := ret[0].(*v3.ClusterListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllCluster indicates an expected call of ListAllCluster. +func (mr *MockServiceMockRecorder) ListAllCluster(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllCluster", reflect.TypeOf((*MockService)(nil).ListAllCluster), arg0, arg1) +} + +// ListAllHost mocks base method. +func (m *MockService) ListAllHost(arg0 context.Context) (*v3.HostListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllHost", arg0) + ret0, _ := ret[0].(*v3.HostListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllHost indicates an expected call of ListAllHost. +func (mr *MockServiceMockRecorder) ListAllHost(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllHost", reflect.TypeOf((*MockService)(nil).ListAllHost), arg0) +} + +// ListAllImage mocks base method. +func (m *MockService) ListAllImage(arg0 context.Context, arg1 string) (*v3.ImageListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllImage", arg0, arg1) + ret0, _ := ret[0].(*v3.ImageListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllImage indicates an expected call of ListAllImage. +func (mr *MockServiceMockRecorder) ListAllImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllImage", reflect.TypeOf((*MockService)(nil).ListAllImage), arg0, arg1) +} + +// ListAllNetworkSecurityRule mocks base method. +func (m *MockService) ListAllNetworkSecurityRule(arg0 context.Context, arg1 string) (*v3.NetworkSecurityRuleListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllNetworkSecurityRule", arg0, arg1) + ret0, _ := ret[0].(*v3.NetworkSecurityRuleListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllNetworkSecurityRule indicates an expected call of ListAllNetworkSecurityRule. +func (mr *MockServiceMockRecorder) ListAllNetworkSecurityRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).ListAllNetworkSecurityRule), arg0, arg1) +} + +// ListAllPermission mocks base method. +func (m *MockService) ListAllPermission(arg0 context.Context, arg1 string) (*v3.PermissionListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllPermission", arg0, arg1) + ret0, _ := ret[0].(*v3.PermissionListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllPermission indicates an expected call of ListAllPermission. +func (mr *MockServiceMockRecorder) ListAllPermission(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllPermission", reflect.TypeOf((*MockService)(nil).ListAllPermission), arg0, arg1) +} + +// ListAllProject mocks base method. +func (m *MockService) ListAllProject(arg0 context.Context, arg1 string) (*v3.ProjectListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllProject", arg0, arg1) + ret0, _ := ret[0].(*v3.ProjectListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllProject indicates an expected call of ListAllProject. +func (mr *MockServiceMockRecorder) ListAllProject(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllProject", reflect.TypeOf((*MockService)(nil).ListAllProject), arg0, arg1) +} + +// ListAllProtectionRules mocks base method. +func (m *MockService) ListAllProtectionRules(arg0 context.Context, arg1 string) (*v3.ProtectionRulesListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllProtectionRules", arg0, arg1) + ret0, _ := ret[0].(*v3.ProtectionRulesListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllProtectionRules indicates an expected call of ListAllProtectionRules. +func (mr *MockServiceMockRecorder) ListAllProtectionRules(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllProtectionRules", reflect.TypeOf((*MockService)(nil).ListAllProtectionRules), arg0, arg1) +} + +// ListAllRecoveryPlans mocks base method. +func (m *MockService) ListAllRecoveryPlans(arg0 context.Context, arg1 string) (*v3.RecoveryPlanListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllRecoveryPlans", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllRecoveryPlans indicates an expected call of ListAllRecoveryPlans. +func (mr *MockServiceMockRecorder) ListAllRecoveryPlans(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllRecoveryPlans", reflect.TypeOf((*MockService)(nil).ListAllRecoveryPlans), arg0, arg1) +} + +// ListAllRole mocks base method. +func (m *MockService) ListAllRole(arg0 context.Context, arg1 string) (*v3.RoleListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllRole", arg0, arg1) + ret0, _ := ret[0].(*v3.RoleListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllRole indicates an expected call of ListAllRole. +func (mr *MockServiceMockRecorder) ListAllRole(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllRole", reflect.TypeOf((*MockService)(nil).ListAllRole), arg0, arg1) +} + +// ListAllServiceGroups mocks base method. +func (m *MockService) ListAllServiceGroups(arg0 context.Context, arg1 string) (*v3.ServiceGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllServiceGroups", arg0, arg1) + ret0, _ := ret[0].(*v3.ServiceGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllServiceGroups indicates an expected call of ListAllServiceGroups. +func (mr *MockServiceMockRecorder) ListAllServiceGroups(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllServiceGroups", reflect.TypeOf((*MockService)(nil).ListAllServiceGroups), arg0, arg1) +} + +// ListAllSubnet mocks base method. +func (m *MockService) ListAllSubnet(arg0 context.Context, arg1 string, arg2 []*prismgoclient.AdditionalFilter) (*v3.SubnetListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllSubnet", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.SubnetListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllSubnet indicates an expected call of ListAllSubnet. +func (mr *MockServiceMockRecorder) ListAllSubnet(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllSubnet", reflect.TypeOf((*MockService)(nil).ListAllSubnet), arg0, arg1, arg2) +} + +// ListAllUser mocks base method. +func (m *MockService) ListAllUser(arg0 context.Context, arg1 string) (*v3.UserListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllUser", arg0, arg1) + ret0, _ := ret[0].(*v3.UserListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllUser indicates an expected call of ListAllUser. +func (mr *MockServiceMockRecorder) ListAllUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllUser", reflect.TypeOf((*MockService)(nil).ListAllUser), arg0, arg1) +} + +// ListAllUserGroup mocks base method. +func (m *MockService) ListAllUserGroup(arg0 context.Context, arg1 string) (*v3.UserGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllUserGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.UserGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllUserGroup indicates an expected call of ListAllUserGroup. +func (mr *MockServiceMockRecorder) ListAllUserGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllUserGroup", reflect.TypeOf((*MockService)(nil).ListAllUserGroup), arg0, arg1) +} + +// ListAllVM mocks base method. +func (m *MockService) ListAllVM(arg0 context.Context, arg1 string) (*v3.VMListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListAllVM", arg0, arg1) + ret0, _ := ret[0].(*v3.VMListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllVM indicates an expected call of ListAllVM. +func (mr *MockServiceMockRecorder) ListAllVM(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllVM", reflect.TypeOf((*MockService)(nil).ListAllVM), arg0, arg1) +} + +// ListCategories mocks base method. +func (m *MockService) ListCategories(arg0 context.Context, arg1 *v3.CategoryListMetadata) (*v3.CategoryKeyListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCategories", arg0, arg1) + ret0, _ := ret[0].(*v3.CategoryKeyListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCategories indicates an expected call of ListCategories. +func (mr *MockServiceMockRecorder) ListCategories(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCategories", reflect.TypeOf((*MockService)(nil).ListCategories), arg0, arg1) +} + +// ListCategoryValues mocks base method. +func (m *MockService) ListCategoryValues(arg0 context.Context, arg1 string, arg2 *v3.CategoryListMetadata) (*v3.CategoryValueListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCategoryValues", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.CategoryValueListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCategoryValues indicates an expected call of ListCategoryValues. +func (mr *MockServiceMockRecorder) ListCategoryValues(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCategoryValues", reflect.TypeOf((*MockService)(nil).ListCategoryValues), arg0, arg1, arg2) +} + +// ListCluster mocks base method. +func (m *MockService) ListCluster(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.ClusterListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListCluster", arg0, arg1) + ret0, _ := ret[0].(*v3.ClusterListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListCluster indicates an expected call of ListCluster. +func (mr *MockServiceMockRecorder) ListCluster(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListCluster", reflect.TypeOf((*MockService)(nil).ListCluster), arg0, arg1) +} + +// ListHost mocks base method. +func (m *MockService) ListHost(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.HostListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListHost", arg0, arg1) + ret0, _ := ret[0].(*v3.HostListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListHost indicates an expected call of ListHost. +func (mr *MockServiceMockRecorder) ListHost(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListHost", reflect.TypeOf((*MockService)(nil).ListHost), arg0, arg1) +} + +// ListImage mocks base method. +func (m *MockService) ListImage(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.ImageListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListImage", arg0, arg1) + ret0, _ := ret[0].(*v3.ImageListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListImage indicates an expected call of ListImage. +func (mr *MockServiceMockRecorder) ListImage(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListImage", reflect.TypeOf((*MockService)(nil).ListImage), arg0, arg1) +} + +// ListNetworkSecurityRule mocks base method. +func (m *MockService) ListNetworkSecurityRule(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.NetworkSecurityRuleListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListNetworkSecurityRule", arg0, arg1) + ret0, _ := ret[0].(*v3.NetworkSecurityRuleListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListNetworkSecurityRule indicates an expected call of ListNetworkSecurityRule. +func (mr *MockServiceMockRecorder) ListNetworkSecurityRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).ListNetworkSecurityRule), arg0, arg1) +} + +// ListPermission mocks base method. +func (m *MockService) ListPermission(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.PermissionListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListPermission", arg0, arg1) + ret0, _ := ret[0].(*v3.PermissionListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListPermission indicates an expected call of ListPermission. +func (mr *MockServiceMockRecorder) ListPermission(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPermission", reflect.TypeOf((*MockService)(nil).ListPermission), arg0, arg1) +} + +// ListProject mocks base method. +func (m *MockService) ListProject(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.ProjectListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListProject", arg0, arg1) + ret0, _ := ret[0].(*v3.ProjectListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListProject indicates an expected call of ListProject. +func (mr *MockServiceMockRecorder) ListProject(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProject", reflect.TypeOf((*MockService)(nil).ListProject), arg0, arg1) +} + +// ListProtectionRules mocks base method. +func (m *MockService) ListProtectionRules(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.ProtectionRulesListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListProtectionRules", arg0, arg1) + ret0, _ := ret[0].(*v3.ProtectionRulesListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListProtectionRules indicates an expected call of ListProtectionRules. +func (mr *MockServiceMockRecorder) ListProtectionRules(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListProtectionRules", reflect.TypeOf((*MockService)(nil).ListProtectionRules), arg0, arg1) +} + +// ListRecoveryPlanJobs mocks base method. +func (m *MockService) ListRecoveryPlanJobs(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.RecoveryPlanJobListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRecoveryPlanJobs", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanJobListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRecoveryPlanJobs indicates an expected call of ListRecoveryPlanJobs. +func (mr *MockServiceMockRecorder) ListRecoveryPlanJobs(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRecoveryPlanJobs", reflect.TypeOf((*MockService)(nil).ListRecoveryPlanJobs), arg0, arg1) +} + +// ListRecoveryPlans mocks base method. +func (m *MockService) ListRecoveryPlans(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.RecoveryPlanListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRecoveryPlans", arg0, arg1) + ret0, _ := ret[0].(*v3.RecoveryPlanListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRecoveryPlans indicates an expected call of ListRecoveryPlans. +func (mr *MockServiceMockRecorder) ListRecoveryPlans(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRecoveryPlans", reflect.TypeOf((*MockService)(nil).ListRecoveryPlans), arg0, arg1) +} + +// ListRole mocks base method. +func (m *MockService) ListRole(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.RoleListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListRole", arg0, arg1) + ret0, _ := ret[0].(*v3.RoleListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRole indicates an expected call of ListRole. +func (mr *MockServiceMockRecorder) ListRole(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRole", reflect.TypeOf((*MockService)(nil).ListRole), arg0, arg1) +} + +// ListSubnet mocks base method. +func (m *MockService) ListSubnet(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.SubnetListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListSubnet", arg0, arg1) + ret0, _ := ret[0].(*v3.SubnetListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSubnet indicates an expected call of ListSubnet. +func (mr *MockServiceMockRecorder) ListSubnet(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSubnet", reflect.TypeOf((*MockService)(nil).ListSubnet), arg0, arg1) +} + +// ListUser mocks base method. +func (m *MockService) ListUser(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.UserListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUser", arg0, arg1) + ret0, _ := ret[0].(*v3.UserListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUser indicates an expected call of ListUser. +func (mr *MockServiceMockRecorder) ListUser(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUser", reflect.TypeOf((*MockService)(nil).ListUser), arg0, arg1) +} + +// ListUserGroup mocks base method. +func (m *MockService) ListUserGroup(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.UserGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUserGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.UserGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUserGroup indicates an expected call of ListUserGroup. +func (mr *MockServiceMockRecorder) ListUserGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserGroup", reflect.TypeOf((*MockService)(nil).ListUserGroup), arg0, arg1) +} + +// ListVM mocks base method. +func (m *MockService) ListVM(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.VMListIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListVM", arg0, arg1) + ret0, _ := ret[0].(*v3.VMListIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListVM indicates an expected call of ListVM. +func (mr *MockServiceMockRecorder) ListVM(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVM", reflect.TypeOf((*MockService)(nil).ListVM), arg0, arg1) +} + +// ListVolumeGroup mocks base method. +func (m *MockService) ListVolumeGroup(arg0 context.Context, arg1 *v3.DSMetadata) (*v3.VolumeGroupListResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListVolumeGroup", arg0, arg1) + ret0, _ := ret[0].(*v3.VolumeGroupListResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListVolumeGroup indicates an expected call of ListVolumeGroup. +func (mr *MockServiceMockRecorder) ListVolumeGroup(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVolumeGroup", reflect.TypeOf((*MockService)(nil).ListVolumeGroup), arg0, arg1) +} + +// PerformRecoveryPlanJobAction mocks base method. +func (m *MockService) PerformRecoveryPlanJobAction(arg0 context.Context, arg1, arg2 string, arg3 *v3.RecoveryPlanJobActionRequest) (*v3.RecoveryPlanJobResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PerformRecoveryPlanJobAction", arg0, arg1, arg2, arg3) + ret0, _ := ret[0].(*v3.RecoveryPlanJobResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// PerformRecoveryPlanJobAction indicates an expected call of PerformRecoveryPlanJobAction. +func (mr *MockServiceMockRecorder) PerformRecoveryPlanJobAction(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PerformRecoveryPlanJobAction", reflect.TypeOf((*MockService)(nil).PerformRecoveryPlanJobAction), arg0, arg1, arg2, arg3) +} + +// ProcessProtectionRule mocks base method. +func (m *MockService) ProcessProtectionRule(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProcessProtectionRule", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ProcessProtectionRule indicates an expected call of ProcessProtectionRule. +func (mr *MockServiceMockRecorder) ProcessProtectionRule(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessProtectionRule", reflect.TypeOf((*MockService)(nil).ProcessProtectionRule), arg0, arg1) +} + +// UpdateAccessControlPolicy mocks base method. +func (m *MockService) UpdateAccessControlPolicy(arg0 context.Context, arg1 string, arg2 *v3.AccessControlPolicy) (*v3.AccessControlPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAccessControlPolicy", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.AccessControlPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateAccessControlPolicy indicates an expected call of UpdateAccessControlPolicy. +func (mr *MockServiceMockRecorder) UpdateAccessControlPolicy(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAccessControlPolicy", reflect.TypeOf((*MockService)(nil).UpdateAccessControlPolicy), arg0, arg1, arg2) +} + +// UpdateAddressGroup mocks base method. +func (m *MockService) UpdateAddressGroup(arg0 context.Context, arg1 string, arg2 *v3.AddressGroupInput) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAddressGroup", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAddressGroup indicates an expected call of UpdateAddressGroup. +func (mr *MockServiceMockRecorder) UpdateAddressGroup(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAddressGroup", reflect.TypeOf((*MockService)(nil).UpdateAddressGroup), arg0, arg1, arg2) +} + +// UpdateImage mocks base method. +func (m *MockService) UpdateImage(arg0 context.Context, arg1 string, arg2 *v3.ImageIntentInput) (*v3.ImageIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateImage", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.ImageIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateImage indicates an expected call of UpdateImage. +func (mr *MockServiceMockRecorder) UpdateImage(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateImage", reflect.TypeOf((*MockService)(nil).UpdateImage), arg0, arg1, arg2) +} + +// UpdateNetworkSecurityRule mocks base method. +func (m *MockService) UpdateNetworkSecurityRule(arg0 context.Context, arg1 string, arg2 *v3.NetworkSecurityRuleIntentInput) (*v3.NetworkSecurityRuleIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateNetworkSecurityRule", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.NetworkSecurityRuleIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateNetworkSecurityRule indicates an expected call of UpdateNetworkSecurityRule. +func (mr *MockServiceMockRecorder) UpdateNetworkSecurityRule(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateNetworkSecurityRule", reflect.TypeOf((*MockService)(nil).UpdateNetworkSecurityRule), arg0, arg1, arg2) +} + +// UpdateProject mocks base method. +func (m *MockService) UpdateProject(arg0 context.Context, arg1 string, arg2 *v3.Project) (*v3.Project, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateProject", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.Project) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateProject indicates an expected call of UpdateProject. +func (mr *MockServiceMockRecorder) UpdateProject(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateProject", reflect.TypeOf((*MockService)(nil).UpdateProject), arg0, arg1, arg2) +} + +// UpdateProtectionRule mocks base method. +func (m *MockService) UpdateProtectionRule(arg0 context.Context, arg1 string, arg2 *v3.ProtectionRuleInput) (*v3.ProtectionRuleResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateProtectionRule", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.ProtectionRuleResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateProtectionRule indicates an expected call of UpdateProtectionRule. +func (mr *MockServiceMockRecorder) UpdateProtectionRule(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateProtectionRule", reflect.TypeOf((*MockService)(nil).UpdateProtectionRule), arg0, arg1, arg2) +} + +// UpdateRecoveryPlan mocks base method. +func (m *MockService) UpdateRecoveryPlan(arg0 context.Context, arg1 string, arg2 *v3.RecoveryPlanInput) (*v3.RecoveryPlanResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRecoveryPlan", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.RecoveryPlanResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateRecoveryPlan indicates an expected call of UpdateRecoveryPlan. +func (mr *MockServiceMockRecorder) UpdateRecoveryPlan(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRecoveryPlan", reflect.TypeOf((*MockService)(nil).UpdateRecoveryPlan), arg0, arg1, arg2) +} + +// UpdateRole mocks base method. +func (m *MockService) UpdateRole(arg0 context.Context, arg1 string, arg2 *v3.Role) (*v3.Role, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRole", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.Role) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateRole indicates an expected call of UpdateRole. +func (mr *MockServiceMockRecorder) UpdateRole(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRole", reflect.TypeOf((*MockService)(nil).UpdateRole), arg0, arg1, arg2) +} + +// UpdateServiceGroup mocks base method. +func (m *MockService) UpdateServiceGroup(arg0 context.Context, arg1 string, arg2 *v3.ServiceGroupInput) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateServiceGroup", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceGroup indicates an expected call of UpdateServiceGroup. +func (mr *MockServiceMockRecorder) UpdateServiceGroup(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceGroup", reflect.TypeOf((*MockService)(nil).UpdateServiceGroup), arg0, arg1, arg2) +} + +// UpdateSubnet mocks base method. +func (m *MockService) UpdateSubnet(arg0 context.Context, arg1 string, arg2 *v3.SubnetIntentInput) (*v3.SubnetIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateSubnet", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.SubnetIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateSubnet indicates an expected call of UpdateSubnet. +func (mr *MockServiceMockRecorder) UpdateSubnet(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSubnet", reflect.TypeOf((*MockService)(nil).UpdateSubnet), arg0, arg1, arg2) +} + +// UpdateUser mocks base method. +func (m *MockService) UpdateUser(arg0 context.Context, arg1 string, arg2 *v3.UserIntentInput) (*v3.UserIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateUser", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.UserIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateUser indicates an expected call of UpdateUser. +func (mr *MockServiceMockRecorder) UpdateUser(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateUser", reflect.TypeOf((*MockService)(nil).UpdateUser), arg0, arg1, arg2) +} + +// UpdateVM mocks base method. +func (m *MockService) UpdateVM(arg0 context.Context, arg1 string, arg2 *v3.VMIntentInput) (*v3.VMIntentResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateVM", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.VMIntentResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateVM indicates an expected call of UpdateVM. +func (mr *MockServiceMockRecorder) UpdateVM(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVM", reflect.TypeOf((*MockService)(nil).UpdateVM), arg0, arg1, arg2) +} + +// UpdateVolumeGroup mocks base method. +func (m *MockService) UpdateVolumeGroup(arg0 context.Context, arg1 string, arg2 *v3.VolumeGroupInput) (*v3.VolumeGroupResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateVolumeGroup", arg0, arg1, arg2) + ret0, _ := ret[0].(*v3.VolumeGroupResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateVolumeGroup indicates an expected call of UpdateVolumeGroup. +func (mr *MockServiceMockRecorder) UpdateVolumeGroup(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVolumeGroup", reflect.TypeOf((*MockService)(nil).UpdateVolumeGroup), arg0, arg1, arg2) +} + +// UploadImage mocks base method. +func (m *MockService) UploadImage(arg0 context.Context, arg1, arg2 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UploadImage", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// UploadImage indicates an expected call of UploadImage. +func (mr *MockServiceMockRecorder) UploadImage(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UploadImage", reflect.TypeOf((*MockService)(nil).UploadImage), arg0, arg1, arg2) +} From 68e55a60a1787ed56d977acc3e4f410998fc5212 Mon Sep 17 00:00:00 2001 From: Sid Shukla Date: Wed, 31 Jul 2024 16:02:27 +0200 Subject: [PATCH 6/6] fix lint issues --- controllers/nutanixmachine_controller.go | 1 - controllers/nutanixmachine_controller_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/controllers/nutanixmachine_controller.go b/controllers/nutanixmachine_controller.go index 0834d1ea42..7fa05fd945 100644 --- a/controllers/nutanixmachine_controller.go +++ b/controllers/nutanixmachine_controller.go @@ -393,7 +393,6 @@ func (r *NutanixMachineReconciler) reconcileDelete(rctx *nctx.MachineContext) (r if err != nil { err := fmt.Errorf("failed to delete VM %s with UUID %s: %v", vmName, vmUUID, err) log.Error(err, "failed to delete VM") - conditions.MarkFalse(rctx.NutanixMachine, infrav1.VMProvisionedCondition, infrav1.DeletionFailed, capiv1.ConditionSeverityWarning, err.Error()) return reconcile.Result{}, err diff --git a/controllers/nutanixmachine_controller_test.go b/controllers/nutanixmachine_controller_test.go index f57baa2ba6..ba4e0bba09 100644 --- a/controllers/nutanixmachine_controller_test.go +++ b/controllers/nutanixmachine_controller_test.go @@ -19,7 +19,6 @@ package controllers import ( "context" "errors" - "k8s.io/utils/ptr" "testing" "github.com/golang/mock/gomock" @@ -33,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/utils/ptr" capiv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" ctrl "sigs.k8s.io/controller-runtime"