mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
ref -> $ref
This commit is contained in:
parent
8b8d522228
commit
5819a608b9
@ -190,7 +190,7 @@ func ValidateCustomResourceDefinitionValidation(customResourceValidation *apiext
|
|||||||
// if validation passed otherwise, make sure we can actually construct a schema validator from this custom resource validation.
|
// if validation passed otherwise, make sure we can actually construct a schema validator from this custom resource validation.
|
||||||
if len(allErrs) == 0 {
|
if len(allErrs) == 0 {
|
||||||
if _, err := apiservervalidation.NewSchemaValidator(customResourceValidation); err != nil {
|
if _, err := apiservervalidation.NewSchemaValidator(customResourceValidation); err != nil {
|
||||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("customResourceValidation"), "", fmt.Sprintf("error building validator: %v", err)))
|
allErrs = append(allErrs, field.Invalid(fldPath, "", fmt.Sprintf("error building validator: %v", err)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return allErrs
|
return allErrs
|
||||||
@ -313,7 +313,7 @@ func (v *specStandardValidatorV3) validate(schema *apiextensions.JSONSchemaProps
|
|||||||
}
|
}
|
||||||
|
|
||||||
if schema.Ref != nil {
|
if schema.Ref != nil {
|
||||||
allErrs = append(allErrs, field.Forbidden(fldPath.Child("ref"), "ref is not supported"))
|
allErrs = append(allErrs, field.Forbidden(fldPath.Child("$ref"), "$ref is not supported"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if schema.Type == "null" {
|
if schema.Type == "null" {
|
||||||
|
@ -157,7 +157,7 @@ func (c *CRDFinalizer) deleteInstances(crd *apiextensions.CustomResourceDefiniti
|
|||||||
// directly to the storage instead. Since we control the storage, we know that delete collection works.
|
// directly to the storage instead. Since we control the storage, we know that delete collection works.
|
||||||
crClient, err := c.crClientGetter.GetCustomResourceListerCollectionDeleter(crd)
|
crClient, err := c.crClientGetter.GetCustomResourceListerCollectionDeleter(crd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("unable to find a custom resource client for %s.%s due to %v", crd.Status.AcceptedNames.Plural, crd.Spec.Group, err)
|
err = fmt.Errorf("unable to find a custom resource client for %s.%s: %v", crd.Status.AcceptedNames.Plural, crd.Spec.Group, err)
|
||||||
return apiextensions.CustomResourceDefinitionCondition{
|
return apiextensions.CustomResourceDefinitionCondition{
|
||||||
Type: apiextensions.Terminating,
|
Type: apiextensions.Terminating,
|
||||||
Status: apiextensions.ConditionTrue,
|
Status: apiextensions.ConditionTrue,
|
||||||
|
@ -411,7 +411,7 @@ func TestForbiddenFieldsInSchema(t *testing.T) {
|
|||||||
|
|
||||||
_, err = testserver.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, clientPool)
|
_, err = testserver.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, clientPool)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Fatal("unexpected non-error: ref cannot be non-empty string")
|
t.Fatal("unexpected non-error: $ref cannot be non-empty string")
|
||||||
}
|
}
|
||||||
|
|
||||||
noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = nil
|
noxuDefinition.Spec.Validation.OpenAPIV3Schema.Ref = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user