Repository navigation
compute: fix instance and template meta.yaml mappings - #20591
Open
rileykarson wants to merge 1 commit into
Open
rileykarson wants to merge 1 commit into
rileykarson wants to merge 1 commit into
Conversation
Collaborator
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 661b00c: Diff reportYour PR generated the following diffs in downstream repositories:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes handwritten resource metadata (
meta.yaml) API field mappings for Compute instance and instance template resources where the API fields are already implemented in Terraform:metadata.items.keyandmetadata.items.value(andproperties.metadata.items.{key,value}) tometadataongoogle_compute_instance,google_compute_instance_from_template,google_compute_instance_from_machine_image,google_compute_instance_template, andgoogle_compute_region_instance_template.metadata.itemsis a list of{key, value}objects rather than a primitive map, so coverage tracks the leaf fieldskeyandvaluerather than the non-JSON parentmetadata.items. Terraform'smetadataTypeMapalready expands every map entry intoitems[].keyanditems[].valueand flattens them back on read, and mapping multiple API leaf fields to one Terraform field is standard inmeta.yaml(matchingpartnerMetadata.key/partnerMetadata.value.entries->partner_metadatain these files).networkInterfaces.accessConfigs.setPublicPtrmapped tonetwork_interface.access_config.public_ptr_domain_nameongoogle_compute_instance,google_compute_instance_from_template, andgoogle_compute_instance_from_machine_image.setPublicPtris the API boolean toggle that enablespublicPtrDomainNameand has no standalone behavior without a domain name. Incompute_instance_helpers.go.tmpl,expandAccessConfigssetsac["setPublicPtr"] = truewheneverpublic_ptr_domain_nameis non-empty, andflattenAccessConfigsreadssetPublicPtrto decide whether to populatepublic_ptr_domain_name. (Intentionally omitted on instance templates, wherepublic_ptr_domain_nameisComputed: trueonly.)