@@ -25,8 +25,8 @@ var keypairNameRegex = regexp.MustCompile(`^[A-Za-z0-9@._-]*$`)
2525var emailRegex = regexp .MustCompile (`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` )
2626
2727// machineTypeRegex is a regex pattern for validating machine type format
28- // Pattern: lowercase letter(s) followed by digits, dot, then more digits (e.g., c1 .2, m1.4 , g1a.8)
29- var machineTypeRegex = regexp .MustCompile (`^[a-z]+\d+\.\d+$` )
28+ // Pattern: lowercase letter(s) followed by digits, dot, then more digits (e.g., c2i .2, m2i.8 , g1a.8)
29+ var machineTypeRegex = regexp .MustCompile (`^[a-z]+\d+[a-z]* \.\d+[a-z]*(\.[a-z]+\d+)* $` )
3030
3131// labelKeyRegex validates Kubernetes label keys (must start/end with alphanumeric, can contain -, _, .)
3232// Maximum length: 63 characters
@@ -67,7 +67,7 @@ func ValidateProviderSpecNSecret(spec *api.ProviderSpec, secrets *corev1.Secret)
6767 if spec .MachineType == "" {
6868 errors = append (errors , fmt .Errorf ("providerSpec.machineType is required" ))
6969 } else if ! isValidMachineType (spec .MachineType ) {
70- errors = append (errors , fmt .Errorf ("providerSpec.machineType has invalid format (expected format: c1 .2, m1.4 , etc.)" ))
70+ errors = append (errors , fmt .Errorf ("providerSpec.machineType has invalid format (expected format: c2i .2, m2i.8 , etc.)" ))
7171 }
7272
7373 // ImageID is required unless BootVolume.Source is specified
0 commit comments