1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

Merge pull request #10272 from patrickdillon/gcp-skip-ai-zone-421

OCPBUGS-74672: [release-4.21] GCP: skip AI zones
This commit is contained in:
openshift-merge-bot[bot]
2026-02-03 03:20:34 +00:00
committed by GitHub

View File

@@ -545,7 +545,7 @@ func GetZones(ctx context.Context, svc *compute.Service, project, region string)
defer cancel()
if err := req.Pages(ctx, func(page *compute.ZoneList) error {
for _, zone := range page.Items {
if strings.HasSuffix(zone.Region, region) && strings.EqualFold(zone.Status, "UP") {
if strings.HasSuffix(zone.Region, region) && strings.EqualFold(zone.Status, "UP") && !aiZone(zone.Name) {
zones = append(zones, zone)
}
}
@@ -794,3 +794,12 @@ func (c *Client) GetPrivateServiceConnectEndpoint(ctx context.Context, project s
}
return GetPrivateServiceConnectEndpoint(svc, project, endpoint)
}
// aiZone returns true if the GCP zone follows the AI naming convention.
// Uses the regular expression pattern as documented in GCP API docs:
// "To match zones containing ai in their name, use the filter query parameter with the regular expression name eq '.*-ai.*'."
// e.g. us-south1-ai1b, us-central1-ai1a.
// See: https://docs.cloud.google.com/compute/docs/regions-zones/ai-zones
func aiZone(zone string) bool {
return strings.Contains(zone, "-ai")
}