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
cd236c32
Commit
cd236c32
authored
Nov 17, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17203 from brendandburns/fix3
Auto commit by PR queue bot
parents
3ec4a559
749d5932
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 @
cd236c32
...
...
@@ -110,14 +110,20 @@ func ValidateHorizontalPodAutoscalerStatusUpdate(controller, oldController *exte
}
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
{
allErrs
:=
errs
.
ValidationErrorList
{}
if
len
(
obj
.
Name
)
==
0
{
allErrs
=
append
(
allErrs
,
errs
.
NewFieldInvalid
(
"name"
,
obj
.
Name
,
"name must be non-empty"
))
}
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateObjectMeta
(
&
obj
.
ObjectMeta
,
true
,
ValidateThirdPartyResourceName
)
.
Prefix
(
"metadata"
)
...
)
versions
:=
sets
.
String
{}
for
ix
:=
range
obj
.
Versions
{
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