Skip to content

Commit

Permalink
Merge pull request GoogleCloudPlatform#1430 from maqiuyujoyce/202403-…
Browse files Browse the repository at this point in the history
…observedstate-comment

Return nil when observedState is not found in status
  • Loading branch information
google-oss-prow[bot] authored Mar 26, 2024
2 parents f7dce5d + 78a6fa7 commit 45326d9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/krmtotf/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 45326d9

Please sign in to comment.