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

Fix empty TypeList expands in generated resources (#2233 cherrypick) #2239

Merged
merged 1 commit into from
Oct 12, 2018
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
2 changes: 1 addition & 1 deletion google/resource_binaryauthorization_attestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func expandBinaryAuthorizationAttestorDescription(v interface{}, d *schema.Resou

func expandBinaryAuthorizationAttestorAttestationAuthorityNote(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
2 changes: 1 addition & 1 deletion google/resource_binaryauthorization_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func expandBinaryAuthorizationPolicyClusterAdmissionRulesEnforcementMode(v inter

func expandBinaryAuthorizationPolicyDefaultAdmissionRule(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
6 changes: 3 additions & 3 deletions google/resource_compute_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func expandComputeAutoscalerDescription(v interface{}, d *schema.ResourceData, c

func expandComputeAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -604,7 +604,7 @@ func expandComputeAutoscalerAutoscalingPolicyCooldownPeriod(v interface{}, d *sc

func expandComputeAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -675,7 +675,7 @@ func expandComputeAutoscalerAutoscalingPolicyMetricType(v interface{}, d *schema

func expandComputeAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
4 changes: 2 additions & 2 deletions google/resource_compute_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ func expandComputeDiskZone(v interface{}, d *schema.ResourceData, config *Config

func expandComputeDiskSourceImageEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -1101,7 +1101,7 @@ func expandComputeDiskSnapshot(v interface{}, d *schema.ResourceData, config *Co

func expandComputeDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
8 changes: 4 additions & 4 deletions google/resource_compute_health_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ func expandComputeHealthCheckUnhealthyThreshold(v interface{}, d *schema.Resourc

func expandComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -830,7 +830,7 @@ func expandComputeHealthCheckHttpHealthCheckProxyHeader(v interface{}, d *schema

func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -886,7 +886,7 @@ func expandComputeHealthCheckHttpsHealthCheckProxyHeader(v interface{}, d *schem

func expandComputeHealthCheckTcpHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -942,7 +942,7 @@ func expandComputeHealthCheckTcpHealthCheckProxyHeader(v interface{}, d *schema.

func expandComputeHealthCheckSslHealthCheck(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
6 changes: 3 additions & 3 deletions google/resource_compute_region_autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func expandComputeRegionAutoscalerDescription(v interface{}, d *schema.ResourceD

func expandComputeRegionAutoscalerAutoscalingPolicy(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -600,7 +600,7 @@ func expandComputeRegionAutoscalerAutoscalingPolicyCooldownPeriod(v interface{},

func expandComputeRegionAutoscalerAutoscalingPolicyCpuUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -671,7 +671,7 @@ func expandComputeRegionAutoscalerAutoscalingPolicyMetricType(v interface{}, d *

func expandComputeRegionAutoscalerAutoscalingPolicyLoadBalancingUtilization(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
4 changes: 2 additions & 2 deletions google/resource_compute_region_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ func expandComputeRegionDiskRegion(v interface{}, d *schema.ResourceData, config

func expandComputeRegionDiskDiskEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -775,7 +775,7 @@ func expandComputeRegionDiskSnapshot(v interface{}, d *schema.ResourceData, conf

func expandComputeRegionDiskSourceSnapshotEncryptionKey(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
2 changes: 1 addition & 1 deletion google/resource_compute_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func expandComputeRouterNetwork(v interface{}, d *schema.ResourceData, config *C

func expandComputeRouterBgp(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
4 changes: 2 additions & 2 deletions google/resource_containeranalysis_note.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func expandContainerAnalysisNoteName(v interface{}, d *schema.ResourceData, conf

func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand All @@ -276,7 +276,7 @@ func expandContainerAnalysisNoteAttestationAuthority(v interface{}, d *schema.Re

func expandContainerAnalysisNoteAttestationAuthorityHint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down
8 changes: 4 additions & 4 deletions google/resource_monitoring_alert_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ func expandMonitoringAlertPolicyConditions(v interface{}, d *schema.ResourceData

func expandMonitoringAlertPolicyConditionsConditionAbsent(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -948,7 +948,7 @@ func expandMonitoringAlertPolicyConditionsConditionAbsentAggregationsCrossSeries

func expandMonitoringAlertPolicyConditionsConditionAbsentTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -994,7 +994,7 @@ func expandMonitoringAlertPolicyConditionsName(v interface{}, d *schema.Resource

func expandMonitoringAlertPolicyConditionsConditionThreshold(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down Expand Up @@ -1137,7 +1137,7 @@ func expandMonitoringAlertPolicyConditionsConditionThresholdComparison(v interfa

func expandMonitoringAlertPolicyConditionsConditionThresholdTrigger(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 {
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
Expand Down