From f62c07b48901385c69ad482745ebb6d0a423fb19 Mon Sep 17 00:00:00 2001 From: Daisuke Taniwaki Date: Wed, 13 Mar 2019 15:39:43 +0900 Subject: [PATCH] Make condition easier to read --- sensors/trigger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sensors/trigger.go b/sensors/trigger.go index e5fd0173b6..9d9a1fdfcb 100644 --- a/sensors/trigger.go +++ b/sensors/trigger.go @@ -235,7 +235,7 @@ func (sec *sensorExecutionCtx) createResourceObject(resource *v1alpha1.ResourceO return fmt.Errorf("failed to create resource object. err: %+v", err) } sec.log.Info().Str("kind", liveObj.GetKind()).Str("name", liveObj.GetName()).Msg("created object") - if !errors.IsAlreadyExists(err) { + if err == nil || !errors.IsAlreadyExists(err) { return err } liveObj, err = reIf.Get(obj.GetName(), metav1.GetOptions{})