From 1f09d28ff31242906b9018e67714b71d89b3ec0e Mon Sep 17 00:00:00 2001 From: Patrick Dillon Date: Wed, 28 Jan 2026 16:09:04 -0500 Subject: [PATCH] GCP: skip AI zones Filter out AI zones when discovering zones in the region. AI zones do not have quota for general compute resources, so we should not provision nodes there by default. --- pkg/asset/installconfig/gcp/client.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/asset/installconfig/gcp/client.go b/pkg/asset/installconfig/gcp/client.go index 46e8c791142..8b45ef09aef 100644 --- a/pkg/asset/installconfig/gcp/client.go +++ b/pkg/asset/installconfig/gcp/client.go @@ -392,7 +392,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) } } @@ -616,3 +616,12 @@ func (c *Client) GetKeyRing(ctx context.Context, kmsKeyRef *gcptypes.KMSKeyRefer } return nil, fmt.Errorf("failed to find kms key ring with name %s", keyRingName) } + +// 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") +}