update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
12
vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/ratcheting.go
generated
vendored
12
vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/validation/ratcheting.go
generated
vendored
@@ -165,7 +165,13 @@ func (r *ratchetingValueValidator) Validate(new interface{}) *validate.Result {
|
||||
// If the old value cannot be correlated, then default validation is used.
|
||||
func (r *ratchetingValueValidator) SubPropertyValidator(field string, schema *spec.Schema, rootSchema interface{}, root string, formats strfmt.Registry, options ...validate.Option) validate.ValueValidator {
|
||||
childNode := r.correlation.Key(field)
|
||||
if childNode == nil {
|
||||
if childNode == nil || (r.path == "" && isTypeMetaField(field)) {
|
||||
// Defer to default validation if we cannot correlate the old value
|
||||
// or if we are validating the root object and the field is a metadata
|
||||
// field.
|
||||
//
|
||||
// We cannot ratchet changes to the APIVersion field since they aren't visible.
|
||||
// (both old and new are converted to the same type)
|
||||
return validate.NewSchemaValidator(schema, rootSchema, root, formats, options...)
|
||||
}
|
||||
|
||||
@@ -210,3 +216,7 @@ func (r ratchetingValueValidator) SetPath(path string) {
|
||||
func (r ratchetingValueValidator) Applies(source interface{}, valueKind reflect.Kind) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func isTypeMetaField(path string) bool {
|
||||
return path == "kind" || path == "apiVersion"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user