Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove disk type validation #108

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions pkg/gcp/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,8 @@ import (
)

const (
// DiskTypeStandard is the standard disk type
DiskTypeStandard = "pd-standard"
// DiskTypeSSD is the SSD disk type
DiskTypeSSD = "pd-ssd"
// DiskTypeScratch is the SCRATCH disk type
DiskTypeScratch = "SCRATCH"
// DiskTypePDBalanced is the balanced disk type
DiskTypePDBalanced = "pd-balanced"

// DiskInterfaceNVME is the NVME disk interface
DiskInterfaceNVME = "NVME"
// DiskInterfaceSCSI is the SCSI disk interface
Expand Down Expand Up @@ -105,9 +98,6 @@ func validateGCPDisks(disks []*api.GCPDisk, fldPath *field.Path) []error {
if disk.SizeGb < 20 {
allErrs = append(allErrs, field.Invalid(idxPath.Child("sizeGb"), disk.SizeGb, "disk size must be at least 20 GB"))
}
if disk.Type != DiskTypeStandard && disk.Type != DiskTypeSSD && disk.Type != DiskTypeScratch && disk.Type != DiskTypePDBalanced {
allErrs = append(allErrs, field.NotSupported(idxPath.Child("type"), disk.Type, []string{DiskTypeStandard, DiskTypeSSD, DiskTypeScratch, DiskTypePDBalanced}))
}
if disk.Type == DiskTypeScratch && (disk.Interface != DiskInterfaceNVME && disk.Interface != DiskInterfaceSCSI) {
allErrs = append(allErrs, field.NotSupported(idxPath.Child("interface"), disk.Interface, []string{DiskInterfaceNVME, DiskInterfaceSCSI}))
}
Expand Down