Skip to content

Commit 3eafe6d

Browse files
authored
Update reservation name validation to support reservation block (#5992)
1 parent ee41a91 commit 3eafe6d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pkg/validators/cloud.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ func getProjectIfReservationMatches(resVal cty.Value, reservationName string) st
477477
return ""
478478
}
479479
resAttrs := resVal.AsValueMap()
480-
if getSafeString(resAttrs, "name") != reservationName {
480+
nameVal := strings.Split(getSafeString(resAttrs, "name"), "/reservationBlocks/")[0]
481+
if nameVal != reservationName {
481482
return ""
482483
}
483484
return getSafeString(resAttrs, "project")

0 commit comments

Comments
 (0)