Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed target_resource_details of oci_bastion_session having unexpected diff after creation #1705

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/service/bastion/bastion_session_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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
}

Expand Down