|
|
@@ -434,6 +434,13 @@ const clusterNameValidator = z
|
|
|
.regex(/^[a-z0-9-]{1,61}$/, {
|
|
|
message: 'Lowercase letters, numbers, and "-" only.',
|
|
|
});
|
|
|
+const gkeClusterNameValidator = z
|
|
|
+ .string()
|
|
|
+ .min(1, { message: "Name must be at least 1 character" })
|
|
|
+ .max(20, { message: "Name must be max 20 characters" })
|
|
|
+ .regex(/^[a-z0-9-]{1,61}$/, {
|
|
|
+ message: 'Lowercase letters, numbers, and "-" only.',
|
|
|
+ });
|
|
|
const eksConfigValidator = z.object({
|
|
|
kind: z.literal("EKS"),
|
|
|
clusterName: clusterNameValidator,
|
|
|
@@ -491,7 +498,7 @@ const eksConfigValidator = z.object({
|
|
|
});
|
|
|
const gkeConfigValidator = z.object({
|
|
|
kind: z.literal("GKE"),
|
|
|
- clusterName: clusterNameValidator,
|
|
|
+ clusterName: gkeClusterNameValidator,
|
|
|
clusterVersion: z.string().optional().default(""),
|
|
|
region: gcpRegionValidator,
|
|
|
nodeGroups: gkeNodeGroupValidator.array(),
|