Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5819a608
Commit
5819a608
authored
Jan 22, 2018
by
carlory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref -> $ref
parent
8b8d5222
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
validation.go
...apiserver/pkg/apis/apiextensions/validation/validation.go
+2
-2
crd_finalizer.go
...sions-apiserver/pkg/controller/finalizer/crd_finalizer.go
+1
-1
validation_test.go
...iextensions-apiserver/test/integration/validation_test.go
+1
-1
No files found.
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go
View file @
5819a608
...
...
@@ -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
len
(
allErrs
)
==
0
{
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
...
...
@@ -313,7 +313,7 @@ func (v *specStandardValidatorV3) validate(schema *apiextensions.JSONSchemaProps
}
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"
{
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/finalizer/crd_finalizer.go
View file @
5819a608
...
...
@@ -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.
crClient
,
err
:=
c
.
crClientGetter
.
GetCustomResourceListerCollectionDeleter
(
crd
)
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
{
Type
:
apiextensions
.
Terminating
,
Status
:
apiextensions
.
ConditionTrue
,
...
...
staging/src/k8s.io/apiextensions-apiserver/test/integration/validation_test.go
View file @
5819a608
...
...
@@ -411,7 +411,7 @@ func TestForbiddenFieldsInSchema(t *testing.T) {
_
,
err
=
testserver
.
CreateNewCustomResourceDefinition
(
noxuDefinition
,
apiExtensionClient
,
clientPool
)
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment