Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func GetBeyondcorpSecurityGatewayApiObject(d tpgresource.TerraformResourceData,
serviceDiscoveryProp, err := expandBeyondcorpSecurityGatewayServiceDiscovery(d.Get("service_discovery"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("service_discovery"); !tpgresource.IsEmptyValue(reflect.ValueOf(serviceDiscoveryProp)) && (ok || !reflect.DeepEqual(v, serviceDiscoveryProp)) {
} else if v, ok := d.GetOkExists("service_discovery"); ok || !reflect.DeepEqual(v, serviceDiscoveryProp) {
obj["serviceDiscovery"] = serviceDiscoveryProp
}

Expand Down Expand Up @@ -409,9 +409,14 @@ func expandBeyondcorpSecurityGatewayServiceDiscovery(v interface{}, d tpgresourc
return nil, nil
}
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
if len(l) == 0 {
return nil, nil
}

if l[0] == nil {
transformed := make(map[string]interface{})
return transformed, nil
}
raw := l[0]
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,21 +411,21 @@ func expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualH
transformedUserInfo, err := expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualHeadersUserInfo(original["user_info"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedUserInfo); val.IsValid() && !tpgresource.IsEmptyValue(val) {
} else {
transformed["userInfo"] = transformedUserInfo
}

transformedGroupInfo, err := expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualHeadersGroupInfo(original["group_info"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedGroupInfo); val.IsValid() && !tpgresource.IsEmptyValue(val) {
} else {
transformed["groupInfo"] = transformedGroupInfo
}

transformedDeviceInfo, err := expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualHeadersDeviceInfo(original["device_info"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedDeviceInfo); val.IsValid() && !tpgresource.IsEmptyValue(val) {
} else {
transformed["deviceInfo"] = transformedDeviceInfo
}

Expand All @@ -444,9 +444,14 @@ func expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualH
return nil, nil
}
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
if len(l) == 0 {
return nil, nil
}

if l[0] == nil {
transformed := make(map[string]interface{})
return transformed, nil
}
raw := l[0]
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})
Expand All @@ -470,9 +475,14 @@ func expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualH
return nil, nil
}
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
if len(l) == 0 {
return nil, nil
}

if l[0] == nil {
transformed := make(map[string]interface{})
return transformed, nil
}
raw := l[0]
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})
Expand All @@ -496,9 +506,14 @@ func expandBeyondcorpSecurityGatewayApplicationUpstreamsProxyProtocolContextualH
return nil, nil
}
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
if len(l) == 0 {
return nil, nil
}

if l[0] == nil {
transformed := make(map[string]interface{})
return transformed, nil
}
raw := l[0]
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})
Expand Down