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
91662210
Commit
91662210
authored
Feb 22, 2018
by
Dr. Stefan Schimanski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apimachinery: normal conversion code path for Unstructured in ConvertToVersion
parent
44ffcdd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
versioning.go
...machinery/pkg/runtime/serializer/versioning/versioning.go
+5
-1
No files found.
staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go
View file @
91662210
...
@@ -167,10 +167,14 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru
...
@@ -167,10 +167,14 @@ func (c *codec) Decode(data []byte, defaultGVK *schema.GroupVersionKind, into ru
// conversion if necessary. Unversioned objects (according to the ObjectTyper) are output as is.
// conversion if necessary. Unversioned objects (according to the ObjectTyper) are output as is.
func
(
c
*
codec
)
Encode
(
obj
runtime
.
Object
,
w
io
.
Writer
)
error
{
func
(
c
*
codec
)
Encode
(
obj
runtime
.
Object
,
w
io
.
Writer
)
error
{
switch
obj
.
(
type
)
{
switch
obj
.
(
type
)
{
case
*
runtime
.
Unknown
,
runtime
.
Unstructured
:
case
*
runtime
.
Unknown
:
return
c
.
encoder
.
Encode
(
obj
,
w
)
return
c
.
encoder
.
Encode
(
obj
,
w
)
}
}
// Note: for runtime.Unstructured, the typer will return the GVK in the object and we will do conversion as normal below.
// For the normal runtime.Scheme converter the conversion will be a no-op for Unstructured. For CustomResources
// the conversion will actually do something.
gvks
,
isUnversioned
,
err
:=
c
.
typer
.
ObjectKinds
(
obj
)
gvks
,
isUnversioned
,
err
:=
c
.
typer
.
ObjectKinds
(
obj
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
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