Procházet zdrojové kódy

add AZ check for cluster creation (#4396)

Stefan McShane před 2 roky
rodič
revize
664ae6253a

+ 10 - 0
dashboard/src/lib/clusters/constants.ts

@@ -1368,6 +1368,11 @@ const AWS_VCPUS_QUOTA_RESOLUTION: PreflightCheckResolution = {
     },
   ],
 };
+const UNAVAILABLE_AVAILABILITY_ZONES: PreflightCheckResolution = {
+  title: "Addressing unavailable availability zones",
+  subtitle:
+    "You will need to select another region, as your AWS account does not support enough Availability Zones in the region specified.",
+};
 const OVERLAPPING_CIDR_RESOLUTION: PreflightCheckResolution = {
   title: "Preventing Overlapping CIDR Blocks",
   subtitle:
@@ -1485,6 +1490,11 @@ const SUPPORTED_AWS_PREFLIGHT_CHECKS: PreflightCheck[] = [
     displayName: "Overlapping CIDR blocks",
     resolution: OVERLAPPING_CIDR_RESOLUTION,
   },
+  {
+    name: "availabilityZone",
+    displayName: "Unavailable Availability Zones in region",
+    resolution: UNAVAILABLE_AVAILABILITY_ZONES,
+  },
 ];
 
 const SUPPORTED_AZURE_PREFLIGHT_CHECKS: PreflightCheck[] = [

+ 1 - 0
dashboard/src/lib/clusters/types.ts

@@ -532,6 +532,7 @@ const preflightCheckKeyValidator = z.enum([
   "iamPermissions",
   "authz",
   "enforceCidrUniqueness",
+  "availabilityZone",
 ]);
 type PreflightCheckKey = z.infer<typeof preflightCheckKeyValidator>;
 export const preflightCheckValidator = z.object({