Skip to content

Commit 8c2563c

Browse files
tgc-revival: fix getting primary resource bug (#14296) (#23327)
[upstream:7f812b1b848b10afe77455adb8b92e298e9ea880] Signed-off-by: Modular Magician <[email protected]>
1 parent 343cc7a commit 8c2563c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

google/acctest/tgc_utils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ func determineImportMetadata(steps []resource.TestStep, currentStepIndex int, re
145145
nextStep := steps[currentStepIndex+1]
146146

147147
// Check if it's an import step for our resource
148-
if nextStep.ImportState && (nextStep.ResourceName == resourceName ||
149-
strings.HasSuffix(nextStep.ResourceName, "."+strings.Split(resourceName, ".")[1])) {
148+
if nextStep.ImportState && nextStep.ResourceName == resourceName {
150149
// Capture ignored fields if present
151150
if nextStep.ImportStateVerify && len(nextStep.ImportStateVerifyIgnore) > 0 {
152151
metadata.IgnoredFields = nextStep.ImportStateVerifyIgnore

0 commit comments

Comments
 (0)