Skip to content

Commit

Permalink
solving linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fracappa committed Sep 6, 2024
1 parent 9bca60d commit 9cea8b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/rear-manager/solver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ func (r *SolverReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
ctx = ctrl.LoggerInto(ctx, log)

var solver nodecorev1alpha1.Solver
// var contract reservationv1alpha1.Contract
if err := r.Get(ctx, req.NamespacedName, &solver); client.IgnoreNotFound(err) != nil {
klog.Errorf("Error when getting Solver %s before reconcile: %s", req.NamespacedName, err)
return ctrl.Result{}, err
Expand Down Expand Up @@ -659,16 +658,14 @@ func (r *SolverReconciler) searchPeeringCandidates(ctx context.Context,
return result, nil
}

// TODO: unify this logic with the one of the discovery controller.
func (r *SolverReconciler) selectAvaiablePeeringCandidate(
pcList []advertisementv1alpha1.PeeringCandidate) (*advertisementv1alpha1.PeeringCandidate, error) {

pcList []advertisementv1alpha1.PeeringCandidate) (*advertisementv1alpha1.PeeringCandidate,
error) {
var pc *advertisementv1alpha1.PeeringCandidate

for i := range pcList {
pc = &pcList[i]
// Select the first PeeringCandidate that is not reserved
// TODO: A better default logic should be implemented.

if pc.Spec.Available {
return pc, nil
}
Expand All @@ -678,7 +675,8 @@ func (r *SolverReconciler) selectAvaiablePeeringCandidate(
return nil, errors.NewNotFound(schema.GroupResource{Group: "advertisement", Resource: "PeeringCandidate"}, "PeeringCandidate")
}

func (r *SolverReconciler) createOrGetDiscovery(ctx context.Context, solver *nodecorev1alpha1.Solver) (*advertisementv1alpha1.Discovery, error) {
func (r *SolverReconciler) createOrGetDiscovery(ctx context.Context,
solver *nodecorev1alpha1.Solver) (*advertisementv1alpha1.Discovery, error) {
discovery := &advertisementv1alpha1.Discovery{}

// Get the Discovery
Expand Down
Empty file modified tools/scripts/clean-dev-env.sh
100755 → 100644
Empty file.
Empty file modified tools/scripts/setup.sh
100755 → 100644
Empty file.

0 comments on commit 9cea8b5

Please sign in to comment.