From 4f67ed5586ec885f1bd7164b844bd54aa941ce47 Mon Sep 17 00:00:00 2001 From: Cameron McLaren Date: Tue, 11 Jun 2024 15:14:22 +1000 Subject: [PATCH] Handling a null response for certain values from Private Cloud Appliance Engineered Systems Signed-off-by: Cameron McLaren --- internal/service/core/core_instance_resource.go | 6 ++++++ internal/service/core/core_volume_resource.go | 3 +++ 2 files changed, 9 insertions(+) diff --git a/internal/service/core/core_instance_resource.go b/internal/service/core/core_instance_resource.go index 723c0136aaa..aaf441cce0a 100644 --- a/internal/service/core/core_instance_resource.go +++ b/internal/service/core/core_instance_resource.go @@ -1621,6 +1621,9 @@ func (s *CoreInstanceResourceCrud) SetData() error { if s.Res.ExtendedMetadata != nil { s.D.Set("extended_metadata", tfresource.GenericMapToJsonMap(s.Res.ExtendedMetadata)) + } else { + extended_metadata := map[string]interface{}{} + s.D.Set("extended_metadata", extended_metadata) } if s.Res.FaultDomain != nil { @@ -1728,6 +1731,9 @@ func (s *CoreInstanceResourceCrud) SetData() error { if s.Res.SystemTags != nil { s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } else { + system_tags := map[string]interface{}{} + s.D.Set("system_tags", system_tags) } if s.Res.TimeCreated != nil { diff --git a/internal/service/core/core_volume_resource.go b/internal/service/core/core_volume_resource.go index f8bb1c9c3b3..62e2f694b7c 100644 --- a/internal/service/core/core_volume_resource.go +++ b/internal/service/core/core_volume_resource.go @@ -688,6 +688,9 @@ func (s *CoreVolumeResourceCrud) SetData() error { if s.Res.SystemTags != nil { s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } else { + system_tags := map[string]interface{}{} + s.D.Set("system_tags", system_tags) } if s.Res.TimeCreated != nil {