From 14eabbe7a29653c8957aabc3cc79d889bcbe7910 Mon Sep 17 00:00:00 2001 From: Muvaffak Onus Date: Tue, 22 Feb 2022 14:45:41 +0300 Subject: [PATCH] controller: set async finished condition only if the resource is async Signed-off-by: Muvaffak Onus (cherry picked from commit ca436134cce982dc1aad70883c59db8aa839e569) --- pkg/controller/external.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/controller/external.go b/pkg/controller/external.go index d89eb950..3ff82932 100644 --- a/pkg/controller/external.go +++ b/pkg/controller/external.go @@ -139,7 +139,9 @@ func (e *external) Observe(ctx context.Context, mg xpresource.Managed) (managed. // There might be a case where async operation is finished and the status // update marking it as finished didn't go through. At this point, we are // sure that there is no ongoing operation. - tr.SetConditions(resource.AsyncOperationFinishedCondition()) + if e.config.UseAsync { + tr.SetConditions(resource.AsyncOperationFinishedCondition()) + } // No operation was in progress, our observation completed successfully, and // we have an observation to consume.