Skip to content

Commit

Permalink
Fix stripping zones from GCP regions (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-h64 authored Mar 24, 2024
1 parent 6c5787e commit e374e39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/address/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ func NewGCPAssigner(ctx context.Context, logger *logrus.Entry, project, region s
return nil, errors.Wrap(err, "failed to get region from metadata server")
}
// if cluster-location is zone, extract region from zone
if len(region) > 3 && region[len(region)-3] == '-' {
region = region[:len(region)-3]
if len(region) > 2 && region[len(region)-2] == '-' {
region = region[:len(region)-2]
}
}

Expand Down

0 comments on commit e374e39

Please sign in to comment.