update dependencies (#6267)

Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
hongming
2024-11-06 10:27:06 +08:00
committed by GitHub
parent faf255a084
commit cfebd96a1f
4263 changed files with 341374 additions and 132036 deletions

View File

@@ -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"
}