Skip to content

Commit

Permalink
Merge pull request #11521 from c2thorn/main
Browse files Browse the repository at this point in the history
Merge 6.0 branch into main
  • Loading branch information
c2thorn authored Aug 21, 2024
2 parents bc5def9 + 5041f53 commit 33e0634
Show file tree
Hide file tree
Showing 566 changed files with 3,279 additions and 2,057 deletions.
2 changes: 1 addition & 1 deletion .ci/gcb-generate-diffs-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ steps:
- COMMIT_SHA=$COMMIT_SHA

# Long timeout to enable waiting on VCR test
timeout: 20000s
timeout: 64800s
options:
machineType: 'N1_HIGHCPU_32'

Expand Down
3 changes: 0 additions & 3 deletions docs/content/develop/breaking-changes/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ For more information, see
* <a name="field-removing-diff-suppress"></a> Removing diff suppression from a field.
* For MMv1 resources, removing `diff_suppress_func` from a field.
* For handwritten resources, removing `DiffSuppressFunc` from a field.
* <a name="field-adding-subfield-to-config-mode-attr"></a> Adding a subfield to
a SchemaConfigModeAttr field.
* Subfields of SchemaConfigModeAttr fields are treated as required even if the schema says they are optional.
* Removing update support from a field.

### Making validation more strict
Expand Down
10 changes: 9 additions & 1 deletion mmv1/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ module Properties

# Add a deprecation message for a resource that's been deprecated in the API.
attr_reader :deprecation_message

# Do not apply the default attribution label
attr_reader :skip_attribution_label
end

include Properties
Expand Down Expand Up @@ -342,6 +345,7 @@ def validate
check :taint_resource_on_failed_create, type: :boolean, default: false
check :skip_sweeper, type: :boolean, default: false
check :deprecation_message, type: ::String
check :skip_attribution_label, type: :boolean, default: false

validate_identity unless @identity.nil?
end
Expand Down Expand Up @@ -475,7 +479,11 @@ def add_labels_related_fields(props, parent)
def add_labels_fields(props, parent, labels)
@custom_diff ||= []
if parent.nil? || parent.flatten_object
@custom_diff.append('tpgresource.SetLabelsDiff')
if @skip_attribution_label
@custom_diff.append('tpgresource.SetLabelsDiffWithoutAttributionLabel')
else
@custom_diff.append('tpgresource.SetLabelsDiff')
end
elsif parent.name == 'metadata'
@custom_diff.append('tpgresource.SetMetadataLabelsDiff')
end
Expand Down
6 changes: 0 additions & 6 deletions mmv1/api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,6 @@ def validate
# The "labels" field has type Array, so skip this resource
!(product_name == 'DeploymentManager' && resource_name == 'Deployment') &&

# https://github.com/hashicorp/terraform-provider-google/issues/16219
!(product_name == 'Edgenetwork' && resource_name == 'Network') &&

# https://github.com/hashicorp/terraform-provider-google/issues/16219
!(product_name == 'Edgenetwork' && resource_name == 'Subnet') &&

# "userLabels" is the resource labels field
!(product_name == 'Monitoring' && resource_name == 'NotificationChannel') &&

Expand Down
14 changes: 14 additions & 0 deletions mmv1/products/activedirectory/Domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,20 @@ async: !ruby/object:Api::OpAsync
id_format: '{{name}}'
import_format: ['{{name}}']
autogen_async: true
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'deletion_protection'
default_value: true
description: |
Whether Terraform will be prevented from destroying the domain. Defaults to true.
When a`terraform destroy` or `terraform apply` would delete the domain,
the command will fail if this field is not set to false in Terraform state.
When the field is set to true or unset in Terraform state, a `terraform apply`
or `terraform destroy` that would delete the domain will fail.
When the field is set to false, deleting the domain is allowed.
custom_code: !ruby/object:Provider::Terraform::CustomCode
custom_import: templates/terraform/custom_import/self_link_as_name.erb
pre_delete: 'templates/terraform/pre_delete/active_directory_domain.go.erb'
error_abort_predicates: ['transport_tpg.Is429QuotaError']
examples:
- !ruby/object:Provider::Terraform::Examples
Expand All @@ -67,6 +79,8 @@ examples:
tfgen
# skip the test until Active Directory setup issue got resolved
skip_test: true
ignore_read_extra:
- 'deletion_protection'
parameters:
- !ruby/object:Api::Type::String
name: domainName
Expand Down
14 changes: 14 additions & 0 deletions mmv1/products/activedirectory/go_Domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,20 @@ async:
error:
path: 'error'
message: 'message'
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'deletion_protection'
default_value: true
description: |
Whether Terraform will be prevented from destroying the domain. Defaults to true.
When a`terraform destroy` or `terraform apply` would delete the domain,
the command will fail if this field is not set to false in Terraform state.
When the field is set to true or unset in Terraform state, a `terraform apply`
or `terraform destroy` that would delete the domain will fail.
When the field is set to false, deleting the domain is allowed.
custom_code:
custom_import: 'templates/terraform/custom_import/go/self_link_as_name.tmpl'
pre_delete: 'templates/terraform/pre_delete/go/active_directory_domain.tmpl'
error_abort_predicates:

- 'transport_tpg.Is429QuotaError'
Expand All @@ -63,6 +75,8 @@ examples:
name: 'myorg'
domain_name: 'tfgen'
skip_test: true
ignore_read_extra:
- 'deletion_protection'
parameters:
- name: 'domainName'
type: String
Expand Down
15 changes: 0 additions & 15 deletions mmv1/products/alloydb/Cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,6 @@ properties:
description: |
Output only. Cloud KMS key versions that are being used to protect the database or the backup.
output: true
- !ruby/object:Api::Type::String
name: 'network'
exactly_one_of:
- network
- network_config.0.network
- psc_config.0.psc_enabled
default_from_api: true
deprecation_message: >-
`network` is deprecated and will be removed in a future major release. Instead, use `network_config` to define the network configuration.
description: |
The relative resource name of the VPC network on which the instance can be accessed. It is specified in the following form:
"projects/{projectNumber}/global/networks/{network_id}".
diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress'
- !ruby/object:Api::Type::NestedObject
name: 'networkConfig'
description: |
Expand All @@ -244,7 +230,6 @@ properties:
- !ruby/object:Api::Type::String
name: network
exactly_one_of:
- network
- network_config.0.network
- psc_config.0.psc_enabled
description: |
Expand Down
10 changes: 0 additions & 10 deletions mmv1/products/bigquery/Table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ examples:
vars:
dataset_id: 'dataset_id'
table_id: 'table_id'
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'allow_resource_tags_on_deletion'
description: |
If set to true, it allows table deletion when there are still resource tags attached.
deprecation_message: |
`allow_resource_tags_on_deletion` is deprecated and will be removed in a future major
release. The default behavior will be allowing the presence of resource tags on
deletion after the next major release.
default_value: false
parameters:
# TODO(alexstephen): Remove once we have support for placing
# nested object fields in URL
Expand Down
6 changes: 0 additions & 6 deletions mmv1/products/bigqueryreservation/Reservation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ properties:
default_value: 0
description: |
Maximum number of queries that are allowed to run concurrently in this reservation. This is a soft limit due to asynchronous nature of the system and various optimizations for small queries. Default value is 0 which means that concurrency will be automatically set based on the reservation size.
- !ruby/object:Api::Type::Boolean
name: 'multiRegionAuxiliary'
description: |
Applicable only for reservations located within one of the BigQuery multi-regions (US or EU).
If set to true, this reservation is placed in the organization's secondary region which is designated for disaster recovery purposes. If false, this reservation is placed in the organization's default region.
deprecation_message: "`multi_region_auxiliary` is deprecated and will be removed in a future major release. This field is no longer supported by the BigQuery Reservation API."
- !ruby/object:Api::Type::String
name: 'edition'
immutable: true
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/billing/ProjectInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Enable, disable, or change billing for a project': 'https://cloud.google.com/billing/docs/how-to/modify-project'
api: 'https://cloud.google.com/billing/docs/reference/rest/v1/projects'
id_format: 'projects/{{project}}/billingInfo'
id_format: 'projects/{{project}}'
custom_code: !ruby/object:Provider::Terraform::CustomCode
decoder: templates/terraform/decoders/billing_project_info.go.erb
encoder: templates/terraform/encoders/billing_project_info.go.erb
Expand Down
30 changes: 30 additions & 0 deletions mmv1/products/cloudrunv2/Job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ iam_policy: !ruby/object:Api::Resource::IamPolicy
id_format: 'projects/{{project}}/locations/{{location}}/jobs/{{name}}'
import_format: ['projects/{{project}}/locations/{{location}}/jobs/{{name}}']
autogen_async: true
virtual_fields:
- !ruby/object:Api::Type::Boolean
name: 'deletion_protection'
default_value: true
description: |
Whether Terraform will be prevented from destroying the job. Defaults to true.
When a`terraform destroy` or `terraform apply` would delete the job,
the command will fail if this field is not set to false in Terraform state.
When the field is set to true or unset in Terraform state, a `terraform apply`
or `terraform destroy` that would delete the job will fail.
When the field is set to false, deleting the job is allowed.
custom_code: !ruby/object:Provider::Terraform::CustomCode
pre_delete: 'templates/terraform/pre_delete/cloudrunv2_job_deletion_policy.go.erb'
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_basic'
Expand All @@ -59,11 +72,15 @@ examples:
])"
vars:
cloud_run_job_name: 'cloudrun-job'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_limits'
primary_resource_id: 'default'
vars:
cloud_run_job_name: 'cloudrun-job'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_sql'
primary_resource_id: 'default'
Expand All @@ -79,6 +96,8 @@ examples:
deletion_protection: 'false'
oics_vars_overrides:
deletion_protection: 'false'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_vpcaccess'
primary_resource_id: 'default'
Expand All @@ -90,13 +109,17 @@ examples:
vpc_access_connector_name: 'run-vpc'
vpc_compute_subnetwork_name: 'run-subnetwork'
compute_network_name: 'run-network'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_directvpc'
primary_resource_id: 'default'
primary_resource_name: "fmt.Sprintf(\"tf-test-cloudrun-job%s\", context[\"random_suffix\"\
])"
vars:
cloud_run_job_name: 'cloudrun-job'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_secret'
primary_resource_id: 'default'
Expand All @@ -106,6 +129,8 @@ examples:
vars:
cloud_run_job_name: 'cloudrun-job'
secret_id: 'secret'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_emptydir'
min_version: 'beta'
Expand All @@ -114,6 +139,8 @@ examples:
])"
vars:
cloud_run_job_name: 'cloudrun-job'
ignore_read_extra:
- 'deletion_protection'
- !ruby/object:Provider::Terraform::Examples
name: 'cloudrunv2_job_run_job'
min_version: beta
Expand All @@ -122,6 +149,8 @@ examples:
])"
vars:
cloud_run_job_name: 'cloudrun-job'
ignore_read_extra:
- 'deletion_protection'
parameters:
- !ruby/object:Api::Type::String
name: 'location'
Expand Down Expand Up @@ -328,6 +357,7 @@ properties:
name: 'env'
description: |-
List of environment variables to set in the container.
is_set: true
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Expand Down
Loading

0 comments on commit 33e0634

Please sign in to comment.