Update godeps
This commit is contained in:
parent
423433bc5f
commit
701c5a0e30
482 changed files with 86915 additions and 19741 deletions
15
vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go
generated
vendored
15
vendor/k8s.io/kubernetes/pkg/runtime/serializer/json/json.go
generated
vendored
|
|
@ -31,7 +31,7 @@ import (
|
|||
|
||||
// NewSerializer creates a JSON serializer that handles encoding versioned objects into the proper JSON form. If typer
|
||||
// is not nil, the object has the group, version, and kind fields set.
|
||||
func NewSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.Typer, pretty bool) *Serializer {
|
||||
func NewSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper, pretty bool) *Serializer {
|
||||
return &Serializer{
|
||||
meta: meta,
|
||||
creater: creater,
|
||||
|
|
@ -44,7 +44,7 @@ func NewSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtim
|
|||
// NewYAMLSerializer creates a YAML serializer that handles encoding versioned objects into the proper YAML form. If typer
|
||||
// is not nil, the object has the group, version, and kind fields set. This serializer supports only the subset of YAML that
|
||||
// matches JSON, and will error if constructs are used that do not serialize to JSON.
|
||||
func NewYAMLSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.Typer) *Serializer {
|
||||
func NewYAMLSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer runtime.ObjectTyper) *Serializer {
|
||||
return &Serializer{
|
||||
meta: meta,
|
||||
creater: creater,
|
||||
|
|
@ -56,7 +56,7 @@ func NewYAMLSerializer(meta MetaFactory, creater runtime.ObjectCreater, typer ru
|
|||
type Serializer struct {
|
||||
meta MetaFactory
|
||||
creater runtime.ObjectCreater
|
||||
typer runtime.Typer
|
||||
typer runtime.ObjectTyper
|
||||
yaml bool
|
||||
pretty bool
|
||||
}
|
||||
|
|
@ -111,12 +111,12 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||
if unk, ok := into.(*runtime.Unknown); ok && unk != nil {
|
||||
unk.Raw = originalData
|
||||
unk.ContentType = runtime.ContentTypeJSON
|
||||
unk.GetObjectKind().SetGroupVersionKind(actual)
|
||||
unk.GetObjectKind().SetGroupVersionKind(*actual)
|
||||
return unk, actual, nil
|
||||
}
|
||||
|
||||
if into != nil {
|
||||
typed, _, err := s.typer.ObjectKind(into)
|
||||
types, _, err := s.typer.ObjectKinds(into)
|
||||
switch {
|
||||
case runtime.IsNotRegisteredError(err):
|
||||
if err := codec.NewDecoderBytes(data, new(codec.JsonHandle)).Decode(into); err != nil {
|
||||
|
|
@ -126,6 +126,7 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||
case err != nil:
|
||||
return nil, actual, err
|
||||
default:
|
||||
typed := types[0]
|
||||
if len(actual.Kind) == 0 {
|
||||
actual.Kind = typed.Kind
|
||||
}
|
||||
|
|
@ -158,8 +159,8 @@ func (s *Serializer) Decode(originalData []byte, gvk *unversioned.GroupVersionKi
|
|||
return obj, actual, nil
|
||||
}
|
||||
|
||||
// EncodeToStream serializes the provided object to the given writer. Overrides is ignored.
|
||||
func (s *Serializer) EncodeToStream(obj runtime.Object, w io.Writer, overrides ...unversioned.GroupVersion) error {
|
||||
// Encode serializes the provided object to the given writer.
|
||||
func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error {
|
||||
if s.yaml {
|
||||
json, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue