v1.16.5
This commit is contained in:
@@ -500,3 +500,8 @@ func memoryBalloonModeValidator(fe validator.FieldLevel) bool {
|
||||
|
||||
return IsInSlice(fieldValue, memoryBalloonModeValues)
|
||||
}
|
||||
|
||||
func migrateV2ModeValidator(fe validator.FieldLevel) bool {
|
||||
fieldValue := fe.Field().String()
|
||||
return IsInSlice(fieldValue, migrateV2ModeValues)
|
||||
}
|
||||
|
||||
@@ -336,5 +336,7 @@ func registerAllValidators(validate *validator.Validate) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = validate.RegisterValidation("migrateV2Mode", migrateV2ModeValidator)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ var (
|
||||
watchdogActionValues = []string{"reset", "shutdown", "poweroff", "pause", "none"}
|
||||
|
||||
memoryBalloonModeValues = []string{"auto", "legacy", "none"}
|
||||
|
||||
migrateV2ModeValues = []string{"compute", "disks", "compute_and_disks"}
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user