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
1033c976
Unverified
Commit
1033c976
authored
Jan 12, 2017
by
Morgan Bauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation for implementors of RESTCreateStrategy
parent
0f3403d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
create.go
staging/src/k8s.io/apiserver/pkg/registry/rest/create.go
+7
-1
No files found.
staging/src/k8s.io/apiserver/pkg/registry/rest/create.go
View file @
1033c976
...
...
@@ -44,6 +44,11 @@ type RESTCreateStrategy interface {
// the object. For example: remove fields that are not to be persisted,
// sort order-insensitive list fields, etc. This should not remove fields
// whose presence would be considered a validation error.
//
// Often implemented as a type check and an initailization or clearing of
// status. Clear the status because status changes are internal. External
// callers of an api (users) should not be setting an initial status on
// newly created objects.
PrepareForCreate
(
ctx
genericapirequest
.
Context
,
obj
runtime
.
Object
)
// Validate returns an ErrorList with validation errors or nil. Validate
// is invoked after default fields in the object have been filled in
...
...
@@ -54,7 +59,8 @@ type RESTCreateStrategy interface {
// ensures that code that operates on these objects can rely on the common
// form for things like comparison. Canonicalize is invoked after
// validation has succeeded but before the object has been persisted.
// This method may mutate the object.
// This method may mutate the object. Often implemented as a type check or
// empty method.
Canonicalize
(
obj
runtime
.
Object
)
}
...
...
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