Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix loadBalancer error not catched #366

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion controllers/osccluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,12 @@ func (r *OscClusterReconciler) reconcile(ctx context.Context, clusterScope *scop
conditions.MarkTrue(osccluster, infrastructurev1beta1.RouteTablesReadyCondition)

loadBalancerSvc := r.getLoadBalancerSvc(ctx, *clusterScope)
_, err = reconcileLoadBalancer(ctx, clusterScope, loadBalancerSvc, securityGroupSvc)
reconcileLoadBalancer, err := reconcileLoadBalancer(ctx, clusterScope, loadBalancerSvc, securityGroupSvc)
if err != nil {
clusterScope.Error(err, "failed to reconcile LoadBalancer")
conditions.MarkFalse(osccluster, infrastructurev1beta1.LoadBalancerReadyCondition, infrastructurev1beta1.LoadBalancerFailedReason, clusterv1.ConditionSeverityWarning, err.Error())
return reconcileLoadBalancer, err
}
if clusterScope.OscCluster.Spec.Network.Bastion.Enable {
vmSvc := r.getVmSvc(ctx, *clusterScope)
imageSvc := r.getImageSvc(ctx, *clusterScope)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ func TestReconcileCapacity(t *testing.T) {
vmType := ctc.machineTemplateSpec.Template.Spec.Node.Vm.VmType
capacity := make(corev1.ResourceList)
memory, err := resource.ParseQuantity("4G")
assert.NoError(t, err)
cpu, err := resource.ParseQuantity("2")
assert.NoError(t, err)
capacity[corev1.ResourceMemory] = memory
capacity[corev1.ResourceCPU] = cpu

Expand Down
Loading