From 78a6fa7ee80d2e291b85e722c6cab3fb23e21884 Mon Sep 17 00:00:00 2001 From: Joyce Ma Date: Tue, 26 Mar 2024 04:48:46 +0000 Subject: [PATCH] Return nil when observedState is not found in status --- pkg/krmtotf/resource.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkg/krmtotf/resource.go b/pkg/krmtotf/resource.go index ef7a455f51..ffca60aefe 100644 --- a/pkg/krmtotf/resource.go +++ b/pkg/krmtotf/resource.go @@ -327,10 +327,7 @@ func (r *Resource) AllTopLevelFieldsAreImmutableOrComputed() bool { } func getObservedStateFromStatus(status map[string]interface{}) map[string]interface{} { - observedState, exists, _ := unstructured.NestedMap(status, k8s.ObservedStateFieldName) - if !exists { - observedState = make(map[string]interface{}) - } + observedState, _, _ := unstructured.NestedMap(status, k8s.ObservedStateFieldName) return observedState }