Skip to content

Commit 6ec3369

Browse files
Remove fingerprint check from Image test (#3773) (#2294)
Signed-off-by: Modular Magician <[email protected]>
1 parent b669e02 commit 6ec3369

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

.changelog/3773.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_compute_image_test.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func TestAccComputeImage_update(t *testing.T) {
4848
t, "google_compute_image.foobar", &image),
4949
testAccCheckComputeImageContainsLabel(&image, "my-label", "my-label-value"),
5050
testAccCheckComputeImageContainsLabel(&image, "empty-label", ""),
51-
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
5251
),
5352
},
5453
{
@@ -59,7 +58,6 @@ func TestAccComputeImage_update(t *testing.T) {
5958
testAccCheckComputeImageDoesNotContainLabel(&image, "my-label"),
6059
testAccCheckComputeImageContainsLabel(&image, "empty-label", "oh-look-theres-a-label-now"),
6160
testAccCheckComputeImageContainsLabel(&image, "new-field", "only-shows-up-when-updated"),
62-
testAccCheckComputeImageHasComputedFingerprint(&image, "google_compute_image.foobar"),
6361
),
6462
},
6563
{
@@ -238,28 +236,6 @@ func testAccCheckComputeImageDoesNotContainLabel(image *compute.Image, key strin
238236
}
239237
}
240238

241-
func testAccCheckComputeImageHasComputedFingerprint(image *compute.Image, resource string) resource.TestCheckFunc {
242-
return func(s *terraform.State) error {
243-
// First ensure we actually have a fingerprint
244-
if image.LabelFingerprint == "" {
245-
return fmt.Errorf("No fingerprint set in API read result")
246-
}
247-
248-
state := s.RootModule().Resources[resource]
249-
if state == nil {
250-
return fmt.Errorf("Unable to find resource named %s in resources", resource)
251-
}
252-
253-
storedFingerprint := state.Primary.Attributes["label_fingerprint"]
254-
if storedFingerprint != image.LabelFingerprint {
255-
return fmt.Errorf("Stored fingerprint doesn't match fingerprint found on server; stored '%s', server '%s'",
256-
storedFingerprint, image.LabelFingerprint)
257-
}
258-
259-
return nil
260-
}
261-
}
262-
263239
func testAccCheckComputeImageHasSourceDisk(image *compute.Image) resource.TestCheckFunc {
264240
return func(s *terraform.State) error {
265241
if image.SourceType == "" {

0 commit comments

Comments
 (0)