Skip to content

Commit

Permalink
fix: cluster gpu type validation
Browse files Browse the repository at this point in the history
Signed-off-by: Tengfei Wang <[email protected]>
  • Loading branch information
davidwtf authored and QianChenglong committed May 20, 2020
1 parent bc9ff3f commit 8777bc4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/platform/validation/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ func ValidateClusterFeature(feature *platform.ClusterFeature, fldPath *field.Pat

// ValidateGPUType validates a given GPUType.
func ValidateGPUType(gpuType *platform.GPUType, fldPath *field.Path) field.ErrorList {
return utilvalidation.ValidateEnum(gpuType, fldPath.Child("gpuType"),
if gpuType == nil {
return field.ErrorList{}
}
return utilvalidation.ValidateEnum(*gpuType, fldPath.Child("gpuType"),
[]interface{}{
platform.GPUPhysical,
platform.GPUVirtual,
Expand Down

0 comments on commit 8777bc4

Please sign in to comment.