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
a8ebc131
Commit
a8ebc131
authored
Nov 29, 2016
by
Dr. Stefan Schimanski
Committed by
Dr. Stefan Schimanski
Dec 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround ugorji/go/codecs regression
parent
0301487d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
types.go
pkg/apis/meta/v1/types.go
+23
-1
No files found.
pkg/apis/meta/v1/types.go
View file @
a8ebc131
...
@@ -27,8 +27,9 @@ package v1
...
@@ -27,8 +27,9 @@ package v1
import
(
import
(
"fmt"
"fmt"
"strings"
"strings"
"github.com/ugorji/go/codec"
)
)
// TypeMeta describes an individual object in an API response or request
// TypeMeta describes an individual object in an API response or request
...
@@ -422,6 +423,27 @@ func (vs Verbs) String() string {
...
@@ -422,6 +423,27 @@ func (vs Verbs) String() string {
return
fmt
.
Sprintf
(
"%v"
,
[]
string
(
vs
))
return
fmt
.
Sprintf
(
"%v"
,
[]
string
(
vs
))
}
}
// CodecEncodeSelf is part of the codec.Selfer interface.
func
(
vs
*
Verbs
)
CodecEncodeSelf
(
encoder
*
codec
.
Encoder
)
{
encoder
.
Encode
(
vs
)
}
// CodecDecodeSelf is part of the codec.Selfer interface. It is overwritten here to make sure
// that an empty verbs list is not decoded as nil. On the other hand, an undefined verbs list
// will lead to nil because this decoding for Verbs is not invoked.
//
// TODO(sttts): this is due to a ugorji regression: https://github.com/ugorji/go/issues/119. Remove the
// workaround when the regression is fixed.
func
(
vs
*
Verbs
)
CodecDecodeSelf
(
decoder
*
codec
.
Decoder
)
{
m
:=
[]
string
{}
decoder
.
Decode
(
&
m
)
if
len
(
m
)
==
0
{
*
vs
=
[]
string
{}
}
else
{
*
vs
=
m
}
}
// APIResourceList is a list of APIResource, it is used to expose the name of the
// APIResourceList is a list of APIResource, it is used to expose the name of the
// resources supported in a specific group and version, and if the resource
// resources supported in a specific group and version, and if the resource
// is namespaced.
// is namespaced.
...
...
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