From 741b2af5ce9dbf295ffb37fc1ea2318e46c70776 Mon Sep 17 00:00:00 2001 From: Kazuki Oishi Date: Sun, 6 Nov 2022 13:51:30 +0000 Subject: [PATCH] Fixed target_resource_details of oci_bastion_session having unexpected diff after creation Signed-off-by: Kazuki Oishi --- internal/service/bastion/bastion_session_resource.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/service/bastion/bastion_session_resource.go b/internal/service/bastion/bastion_session_resource.go index a5b342af259..c28b4dd0c65 100644 --- a/internal/service/bastion/bastion_session_resource.go +++ b/internal/service/bastion/bastion_session_resource.go @@ -599,9 +599,9 @@ func (s *BastionSessionResourceCrud) mapToCreateSessionTargetResourceDetails(fie func TargetResourceDetailsToMap(obj *oci_bastion.TargetResourceDetails) map[string]interface{} { result := map[string]interface{}{} switch v := (*obj).(type) { - case oci_bastion.CreateDynamicPortForwardingSessionTargetResourceDetails: + case oci_bastion.DynamicPortForwardingSessionTargetResourceDetails: result["session_type"] = "DYNAMIC_PORT_FORWARDING" - case oci_bastion.CreateManagedSshSessionTargetResourceDetails: + case oci_bastion.ManagedSshSessionTargetResourceDetails: result["session_type"] = "MANAGED_SSH" if v.TargetResourceId != nil { @@ -619,7 +619,7 @@ func TargetResourceDetailsToMap(obj *oci_bastion.TargetResourceDetails) map[stri if v.TargetResourcePrivateIpAddress != nil { result["target_resource_private_ip_address"] = string(*v.TargetResourcePrivateIpAddress) } - case oci_bastion.CreatePortForwardingSessionTargetResourceDetails: + case oci_bastion.PortForwardingSessionTargetResourceDetails: result["session_type"] = "PORT_FORWARDING" if v.TargetResourceFqdn != nil { @@ -638,7 +638,7 @@ func TargetResourceDetailsToMap(obj *oci_bastion.TargetResourceDetails) map[stri result["target_resource_private_ip_address"] = string(*v.TargetResourcePrivateIpAddress) } default: - log.Printf("[WARN] Received 'session_type' of unknown type %v", *obj) + log.Printf("[WARN] Received 'session_type' of unknown type %T", *obj) return nil }