Skip to content

Commit

Permalink
chore: Tidy up the deployment controller code
Browse files Browse the repository at this point in the history
Removes an unnecessary condition from the deployment controller code. We assumed that the client would return a not-found error on an empty runnerset list  it is clearly not the case.
  • Loading branch information
mumoshu committed Mar 3, 2020
1 parent 31fb7cc commit 70a8c3d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions controllers/runnerdeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/go-logr/logr"
"hash/fnv"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/client-go/tools/record"
Expand Down Expand Up @@ -70,9 +69,7 @@ func (r *RunnerDeploymentReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e

var myRunnerSetList v1alpha1.RunnerSetList
if err := r.List(ctx, &myRunnerSetList, client.InNamespace(req.Namespace), client.MatchingFields{runnerSetOwnerKey: req.Name}); err != nil {
if !errors.IsNotFound(err) {
return ctrl.Result{}, err
}
return ctrl.Result{}, err
}

myRunnerSets := myRunnerSetList.Items
Expand Down

0 comments on commit 70a8c3d

Please sign in to comment.