Skip to content

Commit

Permalink
Fix zone or region detection regex
Browse files Browse the repository at this point in the history
  • Loading branch information
gac3k authored and lbajolet-hashicorp committed Aug 27, 2024
1 parent 69d769e commit ae828dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/common/block_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func GetRegionFromZone(zone string) (string, error) {
return matches[1], nil
}

var zoneRegexp = regexp.MustCompile("^[a-z]+-[a-z]+[0-9]-[a-z]$")
var zoneRegexp = regexp.MustCompile("^[a-z]+-[a-z]+[0-9]{1,2}-[a-z]$")

func IsZoneARegion(zone string) bool {
return !zoneRegexp.MatchString(zone)
Expand Down

0 comments on commit ae828dd

Please sign in to comment.