Skip to content

Commit

Permalink
fix mockgen and unit test
Browse files Browse the repository at this point in the history
Signed-off-by: hanenMizouni <[email protected]>
  • Loading branch information
outscale-hmi committed Dec 10, 2024
1 parent d1695dc commit df160f7
Show file tree
Hide file tree
Showing 7 changed files with 371 additions and 1,681 deletions.
24 changes: 15 additions & 9 deletions cloud/services/compute/mock_compute/vm_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion controllers/osccluster_bastion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func reconcileBastion(ctx context.Context, clusterScope *scope.ClusterScope, vmS
clusterScope.V(4).Info("Bastion is running", "vmId", vmId)
}

if *bastionState == infrastructurev1beta1.VmStateRunning {
if bastionState != nil && *bastionState == infrastructurev1beta1.VmStateRunning {
vmId := bastionSpec.ResourceId

if bastionSpec.PublicIpName != "" && linkPublicIpRef.ResourceMap[bastionPublicIpName] == "" {
Expand All @@ -328,7 +328,10 @@ func reconcileBastion(ctx context.Context, clusterScope *scope.ClusterScope, vmS
clusterScope.V(4).Info("Get bastionPublicIpName", "bastionPublicIpName", bastionPublicIpName)
linkPublicIpRef.ResourceMap[bastionPublicIpName] = linkPublicIpId
}
} else {
clusterScope.V(4).Info("VM is not running, skipping public IP linking")
}

}
clusterScope.V(4).Info("Bastion is reconciled")
return reconcile.Result{}, nil
Expand Down
Loading

0 comments on commit df160f7

Please sign in to comment.