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
749d5932
Commit
749d5932
authored
Nov 12, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to using the real metadata validate function
parent
54e6db08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
validation.go
pkg/apis/extensions/validation/validation.go
+10
-4
No files found.
pkg/apis/extensions/validation/validation.go
View file @
749d5932
...
@@ -110,14 +110,20 @@ func ValidateHorizontalPodAutoscalerStatusUpdate(controller, oldController *exte
...
@@ -110,14 +110,20 @@ func ValidateHorizontalPodAutoscalerStatusUpdate(controller, oldController *exte
}
}
func
ValidateThirdPartyResourceUpdate
(
update
,
old
*
extensions
.
ThirdPartyResource
)
errs
.
ValidationErrorList
{
func
ValidateThirdPartyResourceUpdate
(
update
,
old
*
extensions
.
ThirdPartyResource
)
errs
.
ValidationErrorList
{
return
ValidateThirdPartyResource
(
update
)
allErrs
:=
errs
.
ValidationErrorList
{}
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateObjectMetaUpdate
(
&
update
.
ObjectMeta
,
&
old
.
ObjectMeta
)
.
Prefix
(
"metadata"
)
...
)
allErrs
=
append
(
allErrs
,
ValidateThirdPartyResource
(
update
)
...
)
return
allErrs
}
func
ValidateThirdPartyResourceName
(
name
string
,
prefix
bool
)
(
bool
,
string
)
{
return
apivalidation
.
NameIsDNSSubdomain
(
name
,
prefix
)
}
}
func
ValidateThirdPartyResource
(
obj
*
extensions
.
ThirdPartyResource
)
errs
.
ValidationErrorList
{
func
ValidateThirdPartyResource
(
obj
*
extensions
.
ThirdPartyResource
)
errs
.
ValidationErrorList
{
allErrs
:=
errs
.
ValidationErrorList
{}
allErrs
:=
errs
.
ValidationErrorList
{}
if
len
(
obj
.
Name
)
==
0
{
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateObjectMeta
(
&
obj
.
ObjectMeta
,
true
,
ValidateThirdPartyResourceName
)
.
Prefix
(
"metadata"
)
...
)
allErrs
=
append
(
allErrs
,
errs
.
NewFieldInvalid
(
"name"
,
obj
.
Name
,
"name must be non-empty"
))
}
versions
:=
sets
.
String
{}
versions
:=
sets
.
String
{}
for
ix
:=
range
obj
.
Versions
{
for
ix
:=
range
obj
.
Versions
{
version
:=
&
obj
.
Versions
[
ix
]
version
:=
&
obj
.
Versions
[
ix
]
...
...
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