Skip to content

compute: remove compute library usage from resource_compute_image_test#17664

Draft
GitOleksandrBokov wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:remove-compute-lib-from-image-test
Draft

compute: remove compute library usage from resource_compute_image_test#17664
GitOleksandrBokov wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
GitOleksandrBokov:remove-compute-lib-from-image-test

Conversation

@GitOleksandrBokov
Copy link
Copy Markdown
Contributor

Removes the remaining google.golang.org/api/compute (and the now-unused encoding/json) usage from resource_compute_image_test.go.tmpl, completing its move off the Apiary client.

testAccCheckComputeImageExists now reads the image directly from the transport_tpg.SendRequest response (map[string]interface{}) instead of unmarshaling into compute.Image, and the label / shielded-state / source-type check helpers read their fields from the map. No behavior change — the SendRequest calls were already in place; only the residual compute.Image type usage is removed.

Read the image from the SendRequest response as map[string]interface{} instead of unmarshaling into compute.Image, dropping the google.golang.org/api/compute and encoding/json imports.
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label May 21, 2026
After removing the compute import the file has no Go template syntax left, so TestTemplatesStillNeedToBeTemplates flags it. Drop the .tmpl extension (cf. GoogleCloudPlatform#17648); it is now a plain handwritten test copied verbatim.
Sort imports and fix struct field alignment so the now-plain .go handwritten file passes run-gofmt; the generator previously applied this formatting only to generated output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants