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

compute instance helpers / metadata cleanup #797

Merged
merged 3 commits into from
Nov 29, 2017

Conversation

danawillow
Copy link
Contributor

A few things I noticed while reviewing #639, this:

  • uses the new ParseSubnetwork field helpers, and adds a new one in order to remove the getSubnetworkLink family of functions
  • dedupes metadata flatteners, since there were two that did approximately the same thing. I opted to keep the one that doesn't do any logging/deduping to match a bit more what we tend to do elsewhere but I could just as easily use that one

Since these changes were pretty small I put them in one PR, but they're separate commits in case you feel like reviewing separately.

=== RUN   TestAccComputeProjectMetadataItem_importBasic
=== RUN   TestAccComputeProjectMetadataItem_basic
=== RUN   TestAccComputeProjectMetadataItem_basicMultiple
=== RUN   TestAccComputeProjectMetadataItem_basicWithEmptyVal
=== RUN   TestAccComputeProjectMetadataItem_basicUpdate
--- PASS: TestAccComputeProjectMetadataItem_importBasic (36.09s)
--- PASS: TestAccComputeProjectMetadataItem_basicWithEmptyVal (36.85s)
--- PASS: TestAccComputeProjectMetadataItem_basicMultiple (40.20s)
--- PASS: TestAccComputeProjectMetadataItem_basicUpdate (52.17s)
--- PASS: TestAccComputeProjectMetadataItem_basic (26.98s)

=== RUN   TestAccComputeProjectMetadata_basic
=== RUN   TestAccComputeProjectMetadata_modify_1
=== RUN   TestAccComputeProjectMetadata_modify_2
--- PASS: TestAccComputeProjectMetadata_basic (152.01s)
--- PASS: TestAccComputeProjectMetadata_modify_1 (166.95s)
--- PASS: TestAccComputeProjectMetadata_modify_2 (167.65s)

=== RUN   TestAccComputeInstance_basic1
=== RUN   TestAccComputeInstance_basic2
=== RUN   TestAccComputeInstance_basic3
=== RUN   TestAccComputeInstance_basic4
=== RUN   TestAccComputeInstance_basic5
=== RUN   TestAccComputeInstance_IP
=== RUN   TestAccComputeInstance_GenerateIP
--- PASS: TestAccComputeInstance_GenerateIP (75.19s)
=== RUN   TestAccComputeInstance_diskEncryption
=== RUN   TestAccComputeInstance_attachedDisk
=== RUN   TestAccComputeInstance_attachedDisk_sourceUrl
=== RUN   TestAccComputeInstance_attachedDiskUpdate
=== RUN   TestAccComputeInstance_bootDisk_source
=== RUN   TestAccComputeInstance_bootDisk_sourceUrl
=== RUN   TestAccComputeInstance_bootDisk_type
=== RUN   TestAccComputeInstance_scratchDisk
=== RUN   TestAccComputeInstance_forceNewAndChangeMetadata
=== RUN   TestAccComputeInstance_update
=== RUN   TestAccComputeInstance_service_account
=== RUN   TestAccComputeInstance_scheduling
=== RUN   TestAccComputeInstance_subnet_auto
=== RUN   TestAccComputeInstance_subnet_custom
=== RUN   TestAccComputeInstance_subnet_xpn
=== RUN   TestAccComputeInstance_address_auto
=== RUN   TestAccComputeInstance_address_custom
=== RUN   TestAccComputeInstance_private_image_family
=== RUN   TestAccComputeInstance_forceChangeMachineTypeManually
=== RUN   TestAccComputeInstance_multiNic
=== RUN   TestAccComputeInstance_guestAccelerator
=== RUN   TestAccComputeInstance_minCpuPlatform
=== RUN   TestAccComputeInstance_primaryAliasIpRange
=== RUN   TestAccComputeInstance_secondaryAliasIpRange
--- PASS: TestAccComputeInstance_basic1 (71.96s)
--- FAIL: TestAccComputeInstance_subnet_xpn (1.42s)
	testing.go:435: Step 0 error: Error applying: 1 error(s) occurred:

		* google_compute_network.inst-test-network: 1 error(s) occurred:

		* google_compute_network.inst-test-network: Error creating network: googleapi: Error 403: Required 'compute.networks.create' permission for 'projects/pod5-xpn-host', forbidden
--- PASS: TestAccComputeInstance_service_account (84.07s)
--- PASS: TestAccComputeInstance_subnet_custom (125.01s)
--- PASS: TestAccComputeInstance_private_image_family (286.22s)
--- PASS: TestAccComputeInstance_address_auto (416.30s)
--- PASS: TestAccComputeInstance_address_custom (427.01s)
--- PASS: TestAccComputeInstance_primaryAliasIpRange (38.22s)
--- PASS: TestAccComputeInstance_scheduling (65.45s)
--- PASS: TestAccComputeInstance_guestAccelerator (62.65s)
--- PASS: TestAccComputeInstance_subnet_auto (384.65s)
--- PASS: TestAccComputeInstance_forceChangeMachineTypeManually (213.04s)
--- PASS: TestAccComputeInstance_minCpuPlatform (180.32s)
--- PASS: TestAccComputeInstance_secondaryAliasIpRange (398.26s)
--- PASS: TestAccComputeInstance_basic5 (58.41s)
--- PASS: TestAccComputeInstance_attachedDisk_sourceUrl (81.68s)
--- PASS: TestAccComputeInstance_update (113.44s)
--- PASS: TestAccComputeInstance_multiNic (417.82s)
--- PASS: TestAccComputeInstance_attachedDisk (71.91s)
--- PASS: TestAccComputeInstance_scratchDisk (61.45s)
--- PASS: TestAccComputeInstance_forceNewAndChangeMetadata (116.71s)
--- PASS: TestAccComputeInstance_diskEncryption (81.78s)
--- PASS: TestAccComputeInstance_bootDisk_type (58.98s)
--- PASS: TestAccComputeInstance_bootDisk_source (61.12s)
--- PASS: TestAccComputeInstance_bootDisk_sourceUrl (71.10s)
--- PASS: TestAccComputeInstance_IP (89.02s)
--- PASS: TestAccComputeInstance_basic2 (57.60s)
--- PASS: TestAccComputeInstance_basic3 (65.97s)
--- PASS: TestAccComputeInstance_basic4 (59.92s)
--- PASS: TestAccComputeInstance_attachedDiskUpdate (176.96s)

@danawillow danawillow requested a review from rosbo November 28, 2017 23:54
// support.
func flattenCommonInstanceMetadata(metadata *compute.Metadata) map[string]string {
// be removed in favour of flattenMetadata if/when all resources using it get
// beta support.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is meant for the flattenMetadataBeta func above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah nope it was meant for this one but just referred to the other one wrong. Fixed.

@danawillow danawillow merged commit 50afa7b into hashicorp:master Nov 29, 2017
@danawillow danawillow deleted the 639-followup branch November 29, 2017 17:47
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants