From 8e433427a84869c522a4fd39081e4201ec316e8a Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 5 Oct 2021 17:29:33 +0000 Subject: [PATCH] Osconfig resource (alpha) (#5266) * Adding private compile * Send empty array instead of nil for non-computed arrays * Revert serialize cmd change * Remove extra logs, revert go mod and sum * Revert go sum changes * Delegate DCL version switching to function * Fix extra slash Signed-off-by: Modular Magician --- .changelog/5266.txt | 3 +++ google/resource_assured_workloads_workload.go | 4 ++-- google/resource_compute_firewall_policy_rule.go | 4 ++-- .../resource_compute_global_forwarding_rule.go | 8 ++++---- google/resource_dataproc_workflow_template.go | 12 ++++++------ google/resource_eventarc_trigger.go | 4 ++-- google/resource_org_policy_policy.go | 4 ++-- .../resource_privateca_certificate_template.go | 16 ++++++++-------- 8 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 .changelog/5266.txt diff --git a/.changelog/5266.txt b/.changelog/5266.txt new file mode 100644 index 00000000000..8ec013c0699 --- /dev/null +++ b/.changelog/5266.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google/resource_assured_workloads_workload.go b/google/resource_assured_workloads_workload.go index 6fb534937d9..64189f3427b 100644 --- a/google/resource_assured_workloads_workload.go +++ b/google/resource_assured_workloads_workload.go @@ -458,12 +458,12 @@ func flattenAssuredWorkloadsWorkloadKmsSettings(obj *assuredworkloads.WorkloadKm } func expandAssuredWorkloadsWorkloadResourceSettingsArray(o interface{}) []assuredworkloads.WorkloadResourceSettings { if o == nil { - return nil + return make([]assuredworkloads.WorkloadResourceSettings, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]assuredworkloads.WorkloadResourceSettings, 0) } items := make([]assuredworkloads.WorkloadResourceSettings, 0, len(objs)) diff --git a/google/resource_compute_firewall_policy_rule.go b/google/resource_compute_firewall_policy_rule.go index 397785b752e..10f0bcd7442 100644 --- a/google/resource_compute_firewall_policy_rule.go +++ b/google/resource_compute_firewall_policy_rule.go @@ -419,12 +419,12 @@ func flattenComputeFirewallPolicyRuleMatch(obj *compute.FirewallPolicyRuleMatch) } func expandComputeFirewallPolicyRuleMatchLayer4ConfigsArray(o interface{}) []compute.FirewallPolicyRuleMatchLayer4Configs { if o == nil { - return nil + return make([]compute.FirewallPolicyRuleMatchLayer4Configs, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]compute.FirewallPolicyRuleMatchLayer4Configs, 0) } items := make([]compute.FirewallPolicyRuleMatchLayer4Configs, 0, len(objs)) diff --git a/google/resource_compute_global_forwarding_rule.go b/google/resource_compute_global_forwarding_rule.go index e7aa7d1521e..b5eaf834efd 100644 --- a/google/resource_compute_global_forwarding_rule.go +++ b/google/resource_compute_global_forwarding_rule.go @@ -445,12 +445,12 @@ func resourceComputeGlobalForwardingRuleImport(d *schema.ResourceData, meta inte func expandComputeGlobalForwardingRuleMetadataFilterArray(o interface{}) []compute.ForwardingRuleMetadataFilter { if o == nil { - return nil + return make([]compute.ForwardingRuleMetadataFilter, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]compute.ForwardingRuleMetadataFilter, 0) } items := make([]compute.ForwardingRuleMetadataFilter, 0, len(objs)) @@ -502,12 +502,12 @@ func flattenComputeGlobalForwardingRuleMetadataFilter(obj *compute.ForwardingRul } func expandComputeGlobalForwardingRuleMetadataFilterFilterLabelArray(o interface{}) []compute.ForwardingRuleMetadataFilterFilterLabel { if o == nil { - return nil + return make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0) } items := make([]compute.ForwardingRuleMetadataFilterFilterLabel, 0, len(objs)) diff --git a/google/resource_dataproc_workflow_template.go b/google/resource_dataproc_workflow_template.go index e3bbe91e00f..ea4a1bda99e 100644 --- a/google/resource_dataproc_workflow_template.go +++ b/google/resource_dataproc_workflow_template.go @@ -1920,12 +1920,12 @@ func resourceDataprocWorkflowTemplateImport(d *schema.ResourceData, meta interfa func expandDataprocWorkflowTemplateJobsArray(o interface{}) []dataproc.WorkflowTemplateJobs { if o == nil { - return nil + return make([]dataproc.WorkflowTemplateJobs, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]dataproc.WorkflowTemplateJobs, 0) } items := make([]dataproc.WorkflowTemplateJobs, 0, len(objs)) @@ -2701,12 +2701,12 @@ func flattenDataprocWorkflowTemplatePlacementManagedCluster(obj *dataproc.Workfl } func expandDataprocWorkflowTemplateParametersArray(o interface{}) []dataproc.WorkflowTemplateParameters { if o == nil { - return nil + return make([]dataproc.WorkflowTemplateParameters, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]dataproc.WorkflowTemplateParameters, 0) } items := make([]dataproc.WorkflowTemplateParameters, 0, len(objs)) @@ -3214,12 +3214,12 @@ func flattenDataprocWorkflowTemplateClusterClusterConfigGceClusterConfigReservat } func expandDataprocWorkflowTemplateClusterClusterConfigInitializationActionsArray(o interface{}) []dataproc.ClusterClusterConfigInitializationActions { if o == nil { - return nil + return make([]dataproc.ClusterClusterConfigInitializationActions, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]dataproc.ClusterClusterConfigInitializationActions, 0) } items := make([]dataproc.ClusterClusterConfigInitializationActions, 0, len(objs)) diff --git a/google/resource_eventarc_trigger.go b/google/resource_eventarc_trigger.go index 17511ababa5..d2816a3158b 100644 --- a/google/resource_eventarc_trigger.go +++ b/google/resource_eventarc_trigger.go @@ -515,14 +515,14 @@ func flattenEventarcTriggerDestinationCloudRunService(obj *eventarc.TriggerDesti } func expandEventarcTriggerMatchingCriteriaArray(o interface{}) []eventarc.TriggerMatchingCriteria { if o == nil { - return nil + return make([]eventarc.TriggerMatchingCriteria, 0) } o = o.(*schema.Set).List() objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]eventarc.TriggerMatchingCriteria, 0) } items := make([]eventarc.TriggerMatchingCriteria, 0, len(objs)) diff --git a/google/resource_org_policy_policy.go b/google/resource_org_policy_policy.go index 2d09ede5011..c8df88cd772 100644 --- a/google/resource_org_policy_policy.go +++ b/google/resource_org_policy_policy.go @@ -381,12 +381,12 @@ func flattenOrgPolicyPolicySpec(obj *orgpolicy.PolicySpec) interface{} { } func expandOrgPolicyPolicySpecRulesArray(o interface{}) []orgpolicy.PolicySpecRules { if o == nil { - return nil + return make([]orgpolicy.PolicySpecRules, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]orgpolicy.PolicySpecRules, 0) } items := make([]orgpolicy.PolicySpecRules, 0, len(objs)) diff --git a/google/resource_privateca_certificate_template.go b/google/resource_privateca_certificate_template.go index 4f28f7888a4..5fc6fae93cb 100644 --- a/google/resource_privateca_certificate_template.go +++ b/google/resource_privateca_certificate_template.go @@ -774,12 +774,12 @@ func flattenPrivatecaCertificateTemplatePassthroughExtensions(obj *privateca.Cer } func expandPrivatecaCertificateTemplatePassthroughExtensionsAdditionalExtensionsArray(o interface{}) []privateca.CertificateTemplatePassthroughExtensionsAdditionalExtensions { if o == nil { - return nil + return make([]privateca.CertificateTemplatePassthroughExtensionsAdditionalExtensions, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]privateca.CertificateTemplatePassthroughExtensionsAdditionalExtensions, 0) } items := make([]privateca.CertificateTemplatePassthroughExtensionsAdditionalExtensions, 0, len(objs)) @@ -863,12 +863,12 @@ func flattenPrivatecaCertificateTemplatePredefinedValues(obj *privateca.Certific } func expandPrivatecaCertificateTemplatePredefinedValuesAdditionalExtensionsArray(o interface{}) []privateca.CertificateTemplatePredefinedValuesAdditionalExtensions { if o == nil { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesAdditionalExtensions, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesAdditionalExtensions, 0) } items := make([]privateca.CertificateTemplatePredefinedValuesAdditionalExtensions, 0, len(objs)) @@ -1084,12 +1084,12 @@ func flattenPrivatecaCertificateTemplatePredefinedValuesKeyUsageExtendedKeyUsage } func expandPrivatecaCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsagesArray(o interface{}) []privateca.CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages { if o == nil { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages, 0) } items := make([]privateca.CertificateTemplatePredefinedValuesKeyUsageUnknownExtendedKeyUsages, 0, len(objs)) @@ -1139,12 +1139,12 @@ func flattenPrivatecaCertificateTemplatePredefinedValuesKeyUsageUnknownExtendedK } func expandPrivatecaCertificateTemplatePredefinedValuesPolicyIdsArray(o interface{}) []privateca.CertificateTemplatePredefinedValuesPolicyIds { if o == nil { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesPolicyIds, 0) } objs := o.([]interface{}) if len(objs) == 0 { - return nil + return make([]privateca.CertificateTemplatePredefinedValuesPolicyIds, 0) } items := make([]privateca.CertificateTemplatePredefinedValuesPolicyIds, 0, len(objs))