chore: Tidy up the deployment controller code

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.
This commit is contained in:
Yusuke Kuoka 2020-03-03 10:50:52 +09:00
parent 31fb7cc113
commit 70a8c3db0d
1 changed files with 1 additions and 4 deletions

View File

@ -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"
@ -70,10 +69,8 @@ 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
}
}
myRunnerSets := myRunnerSetList.Items