// Validate ensures that the specified values fall within the range of the strategy.
175213
func (s *mustRunAs) Validate(fldPath *field.Path, _ *api.Pod, _ *api.Container, runAsNonRoot *bool, runAsUser *int64) field.ErrorList {
	allErrs := field.ErrorList{}

	if runAsUser == nil {
		allErrs = append(allErrs, field.Required(fldPath.Child("runAsUser"), ""))
		return allErrs
	}

	if *s.opts.UID != *runAsUser {
		detail := fmt.Sprintf("must be: %v", *s.opts.UID)
		allErrs = append(allErrs, field.Invalid(fldPath.Child("runAsUser"), *runAsUser, detail))
		return allErrs
	}

	return allErrs
}
1347024
func (v *validator) Validate(cons Value) ([]string, error) {
	unsupported := v.checkUnsupported(cons)
	if err := v.checkConflicts(cons); err != nil {
		return unsupported, err
	}
	if err := v.checkValidValues(cons); err != nil {
		return unsupported, err
	}
	return unsupported, nil
}
327475
func (e *RequiredValidator) Validate(s interface{}) error {
	if e.TagName == "" {
		e.TagName = "required"
	}

	if e.TagValue == "" {
		e.TagValue = "true"
	}

	for _, field := range structs.Fields(s) {
		if err := e.processField("", field); err != nil {
			return err
		}
	}

	return nil
}
137511
func (m *Error) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateCode(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateHelpURL(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateMessage(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
116138
func (autoscalerStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	autoscaler := obj.(*autoscaling.HorizontalPodAutoscaler)
	return validation.ValidateHorizontalPodAutoscaler(autoscaler)
}
844707
func (q Queue) Validate(region string, targetList *TargetList) error {
	if region != "" && q.ARN.region != region {
		return &ErrUnknownRegion{q.ARN.region}
	}

	if !targetList.Exists(q.ARN.TargetID) {
		return &ErrARNNotFound{q.ARN}
	}

	return nil
}
1358484
func Validate(m []Validation) error {
	for _, item := range m {
		v := reflect.ValueOf(item.TargetValue)
		for _, constraint := range item.Constraints {
			var err error
			switch v.Kind() {
			case reflect.Ptr:
				err = validatePtr(v, constraint)
			case reflect.String:
				err = validateString(v, constraint)
			case reflect.Struct:
				err = validateStruct(v, constraint)
			case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
				err = validateInt(v, constraint)
			case reflect.Float32, reflect.Float64:
				err = validateFloat(v, constraint)
			case reflect.Array, reflect.Slice, reflect.Map:
				err = validateArrayMap(v, constraint)
			default:
				err = createError(v, constraint, fmt.Sprintf("unknown type %v", v.Kind()))
			}

			if err != nil {
				return err
			}
		}
	}
	return nil
}
382107
func (strategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
	return validation.ValidateBuildConfig(obj.(*buildapi.BuildConfig))
}
1022948
func (pTypeDef *MapTest) Validate() error {
	if pTypeDef.Locations == nil {
		return fmt.Errorf("MapTest: Missing required field: locations")
	}
	return nil
}
1054761
func (c *CmdClause) Validate(validator CmdClauseValidator) *CmdClause {
	c.validator = validator
	return c
}
990279
func (m *RuntimeFilter) Validate() error {
	if m == nil {
		return nil
	}

	if len(m.GetRuntimeKey()) < 1 {
		return RuntimeFilterValidationError{
			field:  "RuntimeKey",
			reason: "value length must be at least 1 bytes",
		}
	}

	{
		tmp := m.GetPercentSampled()

		if v, ok := interface{}(tmp).(interface{ Validate() error }); ok {

			if err := v.Validate(); err != nil {
				return RuntimeFilterValidationError{
					field:  "PercentSampled",
					reason: "embedded message failed validation",
					cause:  err,
				}
			}
		}
	}

	// no validation rules for UseIndependentRandomness

	return nil
}
1217156
func (d multiValidator) Validate(s interface{}) error {
	for _, validator := range d {
		if err := validator.Validate(s); err != nil {
			return err
		}
	}

	return nil
}
991174
func (v *Validator) Validate(i interface{}) error {
	value := reflects.Indirect(reflect.ValueOf(i))
	if value.Kind() != reflect.Struct {
		return errors.New("valid: target value must be a struct")
	}

	key := v.Tag
	if key == "" {
		key = Tag
	}
	ctx := &Context{messages: messages}
	sv := reflects.StructOf(value)
	return sv.VisitFields(func(fv reflect.Value, fi *reflect.StructField) error {
		rules, err := v.parseRules(fi.Tag.Get(key))
		if err != nil {
			return err
		}

		if len(rules) == 0 {
			fv = reflects.Indirect(fv)
			if fv.Kind() == reflect.Struct && fv.IsValid() {
				return v.Validate(fv.Interface())
			}
			return nil
		}

		ctx.Value, ctx.Info = fv, fi
		for name, info := range rules {
			if r := v.getRule(name); r != nil {
				if err = r(ctx, &info); err != nil {
					return &Error{Field: fi.Name, Rule: name, cause: err}
				}
			} else {
				return errors.New("unknown rule: " + name)
			}
		}
		return nil
	})
}
1308779
func (cfg Config) Validate() error {
	if cfg.Enabled && cfg.Target == nil {
		return errors.NewNotValid(nil, "logging enabled but no target provided")
	}
	return nil
}
993062
func (c *EnumConstraint) Validate(v interface{}) (err error) {
	if pdebug.Enabled {
		g := pdebug.Marker("EnumConstraint.Validate (%s)", v).BindError(&err)
		defer g.End()
	}
	for _, e := range c.enums {
		if e == v {
			return nil
		}
	}
	return errors.New("value is not in enumeration")
}
1097301
func (c *GroupsCreateCall) Validate(validate bool) *GroupsCreateCall {
	c.validate = validate
	return c
}
171348
func (m *FaultRateLimit_FixedLimit) Validate() error {
	if m == nil {
		return nil
	}

	if m.GetLimitKbps() < 1 {
		return FaultRateLimit_FixedLimitValidationError{
			field:  "LimitKbps",
			reason: "value must be greater than or equal to 1",
		}
	}

	return nil
}