From 4baefe25ebe7a00e60477f726502b9953705072f Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Tue, 8 Dec 2020 11:27:32 +0000 Subject: [PATCH] fix: Find project for existing key correctly The error would always be returned if the first entry in the project list wasn't the one we were looking for. Instead, check all entries, then error if it wasn't found --- controllers/projectkey_controller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/projectkey_controller.go b/controllers/projectkey_controller.go index 2a7992a..cd8bfb9 100644 --- a/controllers/projectkey_controller.go +++ b/controllers/projectkey_controller.go @@ -197,7 +197,9 @@ func (r *ProjectKeyReconciler) getExistingState(projectkey sentryv1alpha1.Projec projectSlug = sProject.Slug break } + } + if projectSlug == "" { return nil, "", ErrOutOfSync }