mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Add a streaming and "raw" abstraction to codec factory
This commit is contained in:
@@ -39,9 +39,15 @@ var Versions = []string{"v1"}
|
||||
|
||||
// Codec is the default codec for serializing input that should use
|
||||
// the latest supported version. It supports JSON by default.
|
||||
var Codec = versioning.NewCodecForScheme(
|
||||
api.Scheme,
|
||||
json.NewSerializer(json.DefaultMetaFactory, api.Scheme, runtime.ObjectTyperToTyper(api.Scheme), true),
|
||||
[]unversioned.GroupVersion{{Version: Version}},
|
||||
[]unversioned.GroupVersion{{Version: runtime.APIVersionInternal}},
|
||||
)
|
||||
var Codec runtime.Codec
|
||||
|
||||
func init() {
|
||||
jsonSerializer := json.NewSerializer(json.DefaultMetaFactory, api.Scheme, runtime.ObjectTyperToTyper(api.Scheme), true)
|
||||
Codec = versioning.NewCodecForScheme(
|
||||
api.Scheme,
|
||||
jsonSerializer,
|
||||
jsonSerializer,
|
||||
[]unversioned.GroupVersion{{Version: Version}},
|
||||
[]unversioned.GroupVersion{{Version: runtime.APIVersionInternal}},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user