From 70a8c3db0df3ad2153e33c5d777bdc196b6049e7 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 3 Mar 2020 10:50:52 +0900 Subject: [PATCH] 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. --- controllers/runnerdeployment_controller.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/controllers/runnerdeployment_controller.go b/controllers/runnerdeployment_controller.go index 84368e0b09..3582caaad7 100644 --- a/controllers/runnerdeployment_controller.go +++ b/controllers/runnerdeployment_controller.go @@ -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,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