You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returntestFatal(fmt.Errorf("ImportStateVerify: New resource missing identifier attribute %q, ensure attribute value is properly set or use ImportStateVerifyIdentifierAttribute to choose different attribute", identifierAttribute))
returntestFatal(fmt.Errorf("ImportStateVerify: Old resource missing identifier attribute %q, ensure attribute value is properly set or use ImportStateVerifyIdentifierAttribute to choose different attribute", identifierAttribute))
340
-
}
335
+
if!ok {
336
+
returntestFatal(fmt.Errorf("ImportStateVerify: New resource missing identifier attribute %q, ensure attribute value is properly set or use ImportStateVerifyIdentifierAttribute to choose different attribute", identifierAttribute))
returntestFatal(fmt.Errorf("ImportStateVerify: Old resource missing identifier attribute %q, ensure attribute value is properly set or use ImportStateVerifyIdentifierAttribute to choose different attribute", identifierAttribute))
349
350
}
350
351
351
-
// don't add empty flatmapped containers, so we can more easily
// timeouts are only _sometimes_ added to state. To
394
-
// account for this, just don't compare timeouts at
395
-
// all.
389
+
// Remove fields we're ignoring
390
+
for_, v:=rangeimportStateVerifyIgnore {
396
391
fork:=rangeactual {
397
-
ifstrings.HasPrefix(k, "timeouts.") {
398
-
delete(actual, k)
399
-
}
400
-
ifk=="timeouts" {
392
+
ifstrings.HasPrefix(k, v) {
401
393
delete(actual, k)
402
394
}
403
395
}
404
396
fork:=rangeexpected {
405
-
ifstrings.HasPrefix(k, "timeouts.") {
406
-
delete(expected, k)
407
-
}
408
-
ifk=="timeouts" {
397
+
ifstrings.HasPrefix(k, v) {
409
398
delete(expected, k)
410
399
}
411
400
}
401
+
}
412
402
413
-
if!reflect.DeepEqual(actual, expected) {
414
-
// Determine only the different attributes
415
-
// go-cmp tries to show surrounding identical map key/value for
416
-
// context of differences, which may be confusing.
417
-
fork, v:=rangeexpected {
418
-
ifav, ok:=actual[k]; ok&&v==av {
419
-
delete(expected, k)
420
-
delete(actual, k)
421
-
}
422
-
}
403
+
// timeouts are only _sometimes_ added to state. To
404
+
// account for this, just don't compare timeouts at
405
+
// all.
406
+
fork:=rangeactual {
407
+
ifstrings.HasPrefix(k, "timeouts.") {
408
+
delete(actual, k)
409
+
}
410
+
ifk=="timeouts" {
411
+
delete(actual, k)
412
+
}
413
+
}
414
+
fork:=rangeexpected {
415
+
ifstrings.HasPrefix(k, "timeouts.") {
416
+
delete(expected, k)
417
+
}
418
+
ifk=="timeouts" {
419
+
delete(expected, k)
420
+
}
421
+
}
423
422
424
-
ifdiff:=cmp.Diff(expected, actual); diff!="" {
425
-
returntestFail("ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.\n\n%s", diff)
423
+
if!reflect.DeepEqual(actual, expected) {
424
+
// Determine only the different attributes
425
+
// go-cmp tries to show surrounding identical map key/value for
426
+
// context of differences, which may be confusing.
427
+
fork, v:=rangeexpected {
428
+
ifav, ok:=actual[k]; ok&&v==av {
429
+
delete(expected, k)
430
+
delete(actual, k)
426
431
}
427
432
}
433
+
434
+
ifdiff:=cmp.Diff(expected, actual); diff!="" {
435
+
returntestFail("ImportStateVerify attributes not equivalent. Difference is shown below. The - symbol indicates attributes missing after import.\n\n%s", diff)
0 commit comments