Skip to content

Commit

Permalink
Update internal/clouds/general/location.go
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
aronchick and coderabbitai[bot] authored Dec 14, 2024
1 parent 2e306d4 commit 975d05e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/clouds/general/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func ParseRegionZone(input string) (string, string, error) {
}

// Handle GCP style zones (e.g., europe-west3-a)
if parts := strings.Split(input, "-"); len(parts) > 2 && parts[len(parts)-1][0] >= 'a' &&
parts[len(parts)-1][0] <= 'z' {
if parts := strings.Split(input, "-"); len(parts) > 2 && len(parts[len(parts)-1]) > 0 &&
parts[len(parts)-1][0] >= 'a' && parts[len(parts)-1][0] <= 'z' {
// Input is a GCP zone, extract region by removing the last segment
region := strings.Join(parts[:len(parts)-1], "-")
return region, input, nil
Expand Down

0 comments on commit 975d05e

Please sign in to comment.