mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Emit comments before validation code
This commit is contained in:
parent
6ef1a1f98e
commit
311e589534
2
pkg/apis/core/v1/zz_generated.validations.go
generated
2
pkg/apis/core/v1/zz_generated.validations.go
generated
@ -101,8 +101,8 @@ func Validate_ReplicationControllerSpec(ctx context.Context, op operation.Operat
|
||||
// field corev1.ReplicationControllerSpec.MinReadySeconds
|
||||
errs = append(errs,
|
||||
func(fldPath *field.Path, obj, oldObj *int32) (errs field.ErrorList) {
|
||||
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
|
||||
// optional value-type fields with zero-value defaults are purely documentation
|
||||
errs = append(errs, validate.Minimum(ctx, op, fldPath, obj, oldObj, 0)...)
|
||||
return
|
||||
}(fldPath.Child("minReadySeconds"), &obj.MinReadySeconds, safe.Field(oldObj, func(oldObj *corev1.ReplicationControllerSpec) *int32 { return &oldObj.MinReadySeconds }))...)
|
||||
|
||||
|
@ -969,8 +969,8 @@ func (g *genValidations) emitValidationForChild(c *generator.Context, thisChild
|
||||
panic(fmt.Sprintf("unexpected type-validations on type %v, kind %s", thisNode.valueType, thisNode.valueType.Kind))
|
||||
}
|
||||
sw.Do("// type $.inType|raw$\n", targs)
|
||||
emitCallsToValidators(c, validations.Functions, sw)
|
||||
emitComments(validations.Comments, sw)
|
||||
emitCallsToValidators(c, validations.Functions, sw)
|
||||
sw.Do("\n", nil)
|
||||
didSome = true
|
||||
}
|
||||
@ -998,8 +998,8 @@ func (g *genValidations) emitValidationForChild(c *generator.Context, thisChild
|
||||
|
||||
validations := fld.fieldValidations
|
||||
if !validations.Empty() {
|
||||
emitCallsToValidators(c, validations.Functions, bufsw)
|
||||
emitComments(validations.Comments, bufsw)
|
||||
emitCallsToValidators(c, validations.Functions, bufsw)
|
||||
}
|
||||
|
||||
// If the node is nil, this must be a type in a package we are not
|
||||
|
Loading…
Reference in New Issue
Block a user