v1.16.1
v1.16.1
This commit is contained in:
@@ -492,5 +492,11 @@ func sepDescriptionValidator(fe validator.FieldLevel) bool {
|
||||
func watchdogActionValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
|
||||
return IsInSlice(fieldValue, watchdogActionVaues)
|
||||
return IsInSlice(fieldValue, watchdogActionValues)
|
||||
}
|
||||
|
||||
func memoryBalloonModeValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
|
||||
return IsInSlice(fieldValue, memoryBalloonModeValues)
|
||||
}
|
||||
|
||||
@@ -331,5 +331,10 @@ func registerAllValidators(validate *validator.Validate) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = validate.RegisterValidation("memoryBalloonMode", memoryBalloonModeValidator)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -81,7 +81,9 @@ var (
|
||||
|
||||
sepTechStatusValues = []string{"ENABLED", "DISABLED"}
|
||||
|
||||
watchdogActionVaues = []string{"reset", "shutdown", "poweroff", "pause", "none"}
|
||||
watchdogActionValues = []string{"reset", "shutdown", "poweroff", "pause", "none"}
|
||||
|
||||
memoryBalloonModeValues = []string{"auto", "legacy", "none"}
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user