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
3 changes: 3 additions & 0 deletions mmv1/products/compute/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ iam_policy:
parent_resource_attribute: 'instance_name'
iam_conditions_request_type: 'QUERY_PARAM'
include_in_tgc_next: true
tgc_tests:
- name: 'TestAccComputeInstance_secondaryAliasIpRange'
skip: 'data issue with this test'
custom_code:
examples:
- name: 'instance_basic'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ func flattenAdvancedMachineFeaturesTgcNext(v interface{}) []map[string]interface
return nil
}
resp, ok := v.(map[string]interface{})
if !ok {
if !ok || len(resp) == 0 {
return nil
}
return []map[string]interface{}{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func expandComputeInstance(project string, d tpgresource.TerraformResourceData,
Scheduling: scheduling,
DeletionProtection: d.Get("deletion_protection").(bool),
Hostname: d.Get("hostname").(string),
AdvancedMachineFeatures: expandAdvancedMachineFeatures(d),
AdvancedMachineFeatures: expandAdvancedMachineFeaturesTgcNext(d),
ResourcePolicies: tpgresource.ConvertStringArr(d.Get("resource_policies").([]interface{})),
ReservationAffinity: reservationAffinity,
KeyRevocationActionType: d.Get("key_revocation_action_type").(string),
Expand Down Expand Up @@ -656,3 +656,11 @@ func expandComputeLocalSsdRecoveryTimeoutTgc(v interface{}) (*compute.Duration,
}
return duration, nil
}

func expandAdvancedMachineFeaturesTgcNext(d tpgresource.TerraformResourceData) *compute.AdvancedMachineFeatures {
features := expandAdvancedMachineFeatures(d)
if features != nil && features.PerformanceMonitoringUnit == "" {
features.PerformanceMonitoringUnit = "STANDARD"
}
return features
}
1 change: 0 additions & 1 deletion mmv1/third_party/tgc_next/test/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"
)

// test
func TestGetSubTestName(t *testing.T) {
tests := []struct {
name string
Expand Down
Loading