Skip to content

Commit

Permalink
fix loadBalancer error not ctached
Browse files Browse the repository at this point in the history
  • Loading branch information
sebglon committed Sep 3, 2024
1 parent 20beff9 commit aed523b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit aed523b

Please sign in to comment.