Skip to content

Commit 1ac08fc

Browse files
committed
fix: clb instance - skip nullable field set action
1 parent 669fb40 commit 1ac08fc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tencentcloud/resource_tc_clb_listener.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,17 @@ func resourceTencentCloudClbListenerRead(d *schema.ResourceData, meta interface{
526526

527527
_ = d.Set("clb_id", clbId)
528528
_ = d.Set("listener_id", instance.ListenerId)
529-
_ = d.Set("listener_name", instance.ListenerName)
530-
_ = d.Set("target_type", instance.TargetType)
531529
_ = d.Set("port", instance.Port)
532530
_ = d.Set("protocol", instance.Protocol)
533-
_ = d.Set("session_expire_time", instance.SessionExpireTime)
531+
if instance.ListenerName != nil {
532+
_ = d.Set("listener_name", instance.ListenerName)
533+
}
534+
if instance.TargetType != nil {
535+
_ = d.Set("target_type", instance.TargetType)
536+
}
537+
if instance.SessionExpireTime != nil {
538+
_ = d.Set("session_expire_time", instance.SessionExpireTime)
539+
}
534540
if *instance.Protocol == CLB_LISTENER_PROTOCOL_TCP || *instance.Protocol == CLB_LISTENER_PROTOCOL_TCPSSL || *instance.Protocol == CLB_LISTENER_PROTOCOL_UDP {
535541
_ = d.Set("scheduler", instance.Scheduler)
536542
}

0 commit comments

Comments
 (0)