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

Add missing field to disks and support InstantSnapshot #12946

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

karolgorc
Copy link
Contributor

@karolgorc karolgorc commented Feb 3, 2025

closes hashicorp/terraform-provider-google#16426

Added some missing fields to google_compute_disk. One of them is sourceInstantSnapshot so i've added the resource to create instant snapshots into terraform.

One thing i'm having trouble testing is sourceStorageObject. It requires a Bucket with an image stored as *.tar.gz. Only way i've found of recreating this in an acceptance test is using gcloud image export into the bucket but don't know if we want something like that in our tests. Please LMK!

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: added missing fields from the API to `google_compute_disk`. `architecture`, `sourceInstantSnapshot`, `sourceStorageObject`, `resourceManagerTags`
`google_compute_instant_snapshot`

@github-actions github-actions bot requested a review from slevenick February 3, 2025 11:48
Copy link

github-actions bot commented Feb 3, 2025

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Feb 3, 2025
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Is labels updatable? The whole resource is marked immutable but it has update_url set

mmv1/products/compute/InstantSnapshot.yaml Show resolved Hide resolved
mmv1/products/compute/InstantSnapshot.yaml Show resolved Hide resolved
@slevenick
Copy link
Contributor

You should be able to add a tar.gz image into our test-fixtures file (for example for the IAP product: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/iap/test-fixtures) and then upload it via a google_storage_object resource

@karolgorc
Copy link
Contributor Author

Is labels updatable? The whole resource is marked immutable but it has update_url set

Seems that it doesn't matter. It doesn't force replace

image

@github-actions github-actions bot requested a review from slevenick February 4, 2025 10:14
@slevenick
Copy link
Contributor

Is labels updatable? The whole resource is marked immutable but it has update_url set

Seems that it doesn't matter. It doesn't force replace

image

Interesting! Can you add an update test for labels then?

Copy link

github-actions bot commented Feb 7, 2025

@slevenick This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician added service/compute-pd and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Feb 7, 2025
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 17 files changed, 2331 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 17 files changed, 2331 insertions(+), 6 deletions(-))
terraform-google-conversion: Diff ( 5 files changed, 575 insertions(+))
Open in Cloud Shell: Diff ( 4 files changed, 111 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_instant_snapshot (7 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instant_snapshot" "primary" {
  description = # value needed
  labels      = # value needed
}

Resource: google_compute_instant_snapshot_iam_binding (2 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instant_snapshot_iam_binding" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
}

Resource: google_compute_instant_snapshot_iam_member (1 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_instant_snapshot_iam_member" "primary" {
  condition {
    description = # value needed
    expression  = # value needed
    title       = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1111
Passed tests: 952
Skipped tests: 75
Affected tests: 84

Click here to see the affected service packages
  • compute

Action taken

Found 84 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeDiskIamBindingGenerated
  • TestAccComputeDiskIamMemberGenerated
  • TestAccComputeDiskIamPolicyGenerated
  • TestAccComputeDiskResourcePolicyAttachment_diskResourcePolicyAttachmentBasicExample
  • TestAccComputeDiskResourcePolicyAttachment_update
  • TestAccComputeDisk_architecture
  • TestAccComputeDisk_attributionLabelOnCreation
  • TestAccComputeDisk_cloneDisk
  • TestAccComputeDisk_deleteDetach
  • TestAccComputeDisk_diskBasicExample
  • TestAccComputeDisk_encryption
  • TestAccComputeDisk_encryptionKMS
  • TestAccComputeDisk_encryptionWithRSAEncryptedKey
  • TestAccComputeDisk_fromSnapshot
  • TestAccComputeDisk_fromTypeUrl
  • TestAccComputeDisk_resourceManagerTags
  • TestAccComputeDisk_resourcePolicies
  • TestAccComputeDisk_sourceInstantSnapshot
  • TestAccComputeDisk_sourceStorageObject
  • TestAccComputeDisk_update
  • TestAccComputeDisk_updateResourcePolicies
  • TestAccComputeImageIamBindingGenerated
  • TestAccComputeImageIamBindingGenerated_withCondition
  • TestAccComputeImageIamMemberGenerated
  • TestAccComputeImageIamMemberGenerated_withCondition
  • TestAccComputeImageIamPolicyGenerated
  • TestAccComputeImageIamPolicyGenerated_withCondition
  • TestAccComputeImage_basedondisk
  • TestAccComputeImage_imageBasicExample
  • TestAccComputeImage_imageBasicStorageLocationExample
  • TestAccComputeImage_imageGuestOsExample
  • TestAccComputeImage_resolveImage
  • TestAccComputeImage_sourceSnapshot
  • TestAccComputeImage_withLicense
  • TestAccComputeInstanceFromTemplateWithOverride_interface
  • TestAccComputeInstanceFromTemplateWithOverride_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromTemplateWithOverride_partnerMetadata
  • TestAccComputeInstanceFromTemplate_basic
  • TestAccComputeInstanceFromTemplate_confidentialInstanceConfigMain
  • TestAccComputeInstanceFromTemplate_localSsdRecoveryTimeout
  • TestAccComputeInstanceFromTemplate_maxRunDuration_onInstanceStopAction
  • TestAccComputeInstanceFromTemplate_overrideAttachedDisk
  • TestAccComputeInstanceFromTemplate_overrideBootDisk
  • TestAccComputeInstanceFromTemplate_overrideScheduling
  • TestAccComputeInstanceFromTemplate_overrideScratchDisk
  • TestAccComputeInstanceFromTemplate_partnerMetadata
  • TestAccComputeInstanceFromTemplate_self_link_unique
  • TestAccComputeInstanceTemplate_disks
  • TestAccComputeInstanceTemplate_sourceSnapshotEncryptionKey
  • TestAccComputeInstance_bootDisk_source
  • TestAccComputeInstance_bootDisk_sourceUrl
  • TestAccComputeInstance_networkPerformanceConfig
  • TestAccComputeInstance_private_image_family
  • TestAccComputeInstance_regionBootDisk
  • TestAccComputeInstantSnapshotIamBindingGenerated
  • TestAccComputeInstantSnapshotIamMemberGenerated
  • TestAccComputeInstantSnapshotIamPolicyGenerated
  • TestAccComputeInstantSnapshot_basicFeatures
  • TestAccComputeInstantSnapshot_instantSnapshotBasicExample
  • TestAccComputeInstantSnapshot_labelsUpdate
  • TestAccComputePerInstanceConfig_removeInstanceOnDestroy
  • TestAccComputePerInstanceConfig_statefulIps
  • TestAccComputeRegionDiskIamBindingGenerated
  • TestAccComputeRegionDiskIamMemberGenerated
  • TestAccComputeRegionDiskIamPolicyGenerated
  • TestAccComputeRegionDiskResourcePolicyAttachment_regionDiskResourcePolicyAttachmentBasicExample
  • TestAccComputeRegionDisk_basic
  • TestAccComputeRegionDisk_basicUpdate
  • TestAccComputeRegionDisk_cloneDisk
  • TestAccComputeRegionDisk_deleteDetach
  • TestAccComputeRegionDisk_encryption
  • TestAccComputeRegionDisk_regionDiskBasicExample
  • TestAccComputeRegionInstanceTemplate_sourceSnapshotEncryptionKey
  • TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy
  • TestAccComputeRegionPerInstanceConfig_statefulIps
  • TestAccComputeSnapshotIamBindingGenerated
  • TestAccComputeSnapshotIamMemberGenerated
  • TestAccComputeSnapshotIamPolicyGenerated
  • TestAccComputeSnapshot_encryption
  • TestAccComputeSnapshot_snapshotBasicExample
  • TestAccComputeSnapshot_snapshotChainnameExample
  • TestAccSnapshotDatasource_filter
  • TestAccSnapshotDatasource_filterMostRecent
  • TestAccSnapshotDatasource_name

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccComputeDisk_architecture [Debug log]
TestAccComputeDisk_resourceManagerTags [Debug log]
TestAccComputeDisk_sourceInstantSnapshot [Debug log]
TestAccComputeDisk_sourceStorageObject [Debug log]
TestAccComputeInstantSnapshot_basicFeatures [Debug log]
TestAccComputeInstantSnapshot_labelsUpdate [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccComputeInstantSnapshot_basicFeatures [Error message] [Debug log]
TestAccComputeInstantSnapshot_labelsUpdate [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccComputeDiskIamBindingGenerated [Error message] [Debug log]
TestAccComputeDiskIamMemberGenerated [Error message] [Debug log]
TestAccComputeDiskIamPolicyGenerated [Error message] [Debug log]
TestAccComputeDiskResourcePolicyAttachment_diskResourcePolicyAttachmentBasicExample [Error message] [Debug log]
TestAccComputeDiskResourcePolicyAttachment_update [Error message] [Debug log]
TestAccComputeDisk_attributionLabelOnCreation [Error message] [Debug log]
TestAccComputeDisk_cloneDisk [Error message] [Debug log]
TestAccComputeDisk_deleteDetach [Error message] [Debug log]
TestAccComputeDisk_diskBasicExample [Error message] [Debug log]
TestAccComputeDisk_encryption [Error message] [Debug log]
TestAccComputeDisk_encryptionKMS [Error message] [Debug log]
TestAccComputeDisk_encryptionWithRSAEncryptedKey [Error message] [Debug log]
TestAccComputeDisk_fromSnapshot [Error message] [Debug log]
TestAccComputeDisk_fromTypeUrl [Error message] [Debug log]
TestAccComputeDisk_resourcePolicies [Error message] [Debug log]
TestAccComputeDisk_update [Error message] [Debug log]
TestAccComputeDisk_updateResourcePolicies [Error message] [Debug log]
TestAccComputeImageIamBindingGenerated [Error message] [Debug log]
TestAccComputeImageIamBindingGenerated_withCondition [Error message] [Debug log]
TestAccComputeImageIamMemberGenerated [Error message] [Debug log]
TestAccComputeImageIamMemberGenerated_withCondition [Error message] [Debug log]
TestAccComputeImageIamPolicyGenerated [Error message] [Debug log]
TestAccComputeImageIamPolicyGenerated_withCondition [Error message] [Debug log]
TestAccComputeImage_basedondisk [Error message] [Debug log]
TestAccComputeImage_imageBasicExample [Error message] [Debug log]
TestAccComputeImage_imageBasicStorageLocationExample [Error message] [Debug log]
TestAccComputeImage_imageGuestOsExample [Error message] [Debug log]
TestAccComputeImage_resolveImage [Error message] [Debug log]
TestAccComputeImage_sourceSnapshot [Error message] [Debug log]
TestAccComputeImage_withLicense [Error message] [Debug log]
TestAccComputeInstanceFromTemplateWithOverride_interface [Error message] [Debug log]
TestAccComputeInstanceFromTemplateWithOverride_localSsdRecoveryTimeout [Error message] [Debug log]
TestAccComputeInstanceFromTemplateWithOverride_partnerMetadata [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_basic [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_confidentialInstanceConfigMain [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_localSsdRecoveryTimeout [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_maxRunDuration_onInstanceStopAction [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_overrideAttachedDisk [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_overrideBootDisk [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_overrideScheduling [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_overrideScratchDisk [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_partnerMetadata [Error message] [Debug log]
TestAccComputeInstanceFromTemplate_self_link_unique [Error message] [Debug log]
TestAccComputeInstanceTemplate_disks [Error message] [Debug log]
TestAccComputeInstanceTemplate_sourceSnapshotEncryptionKey [Error message] [Debug log]
TestAccComputeInstance_bootDisk_source [Error message] [Debug log]
TestAccComputeInstance_bootDisk_sourceUrl [Error message] [Debug log]
TestAccComputeInstance_networkPerformanceConfig [Error message] [Debug log]
TestAccComputeInstance_private_image_family [Error message] [Debug log]
TestAccComputeInstance_regionBootDisk [Error message] [Debug log]
TestAccComputeInstantSnapshotIamBindingGenerated [Error message] [Debug log]
TestAccComputeInstantSnapshotIamMemberGenerated [Error message] [Debug log]
TestAccComputeInstantSnapshotIamPolicyGenerated [Error message] [Debug log]
TestAccComputeInstantSnapshot_instantSnapshotBasicExample [Error message] [Debug log]
TestAccComputePerInstanceConfig_removeInstanceOnDestroy [Error message] [Debug log]
TestAccComputePerInstanceConfig_statefulIps [Error message] [Debug log]
TestAccComputeRegionDiskIamBindingGenerated [Error message] [Debug log]
TestAccComputeRegionDiskIamMemberGenerated [Error message] [Debug log]
TestAccComputeRegionDiskIamPolicyGenerated [Error message] [Debug log]
TestAccComputeRegionDiskResourcePolicyAttachment_regionDiskResourcePolicyAttachmentBasicExample [Error message] [Debug log]
TestAccComputeRegionDisk_basic [Error message] [Debug log]
TestAccComputeRegionDisk_basicUpdate [Error message] [Debug log]
TestAccComputeRegionDisk_cloneDisk [Error message] [Debug log]
TestAccComputeRegionDisk_deleteDetach [Error message] [Debug log]
TestAccComputeRegionDisk_encryption [Error message] [Debug log]
TestAccComputeRegionDisk_regionDiskBasicExample [Error message] [Debug log]
TestAccComputeRegionInstanceTemplate_sourceSnapshotEncryptionKey [Error message] [Debug log]
TestAccComputeRegionPerInstanceConfig_removeInstanceOnDestroy [Error message] [Debug log]
TestAccComputeRegionPerInstanceConfig_statefulIps [Error message] [Debug log]
TestAccComputeSnapshotIamBindingGenerated [Error message] [Debug log]
TestAccComputeSnapshotIamMemberGenerated [Error message] [Debug log]
TestAccComputeSnapshotIamPolicyGenerated [Error message] [Debug log]
TestAccComputeSnapshot_encryption [Error message] [Debug log]
TestAccComputeSnapshot_snapshotBasicExample [Error message] [Debug log]
TestAccComputeSnapshot_snapshotChainnameExample [Error message] [Debug log]
TestAccSnapshotDatasource_filter [Error message] [Debug log]
TestAccSnapshotDatasource_filterMostRecent [Error message] [Debug log]
TestAccSnapshotDatasource_name [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for "Architecture" attribute for "google_compute_disk"
3 participants