mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-10 03:19:44 +00:00
easy changes
Kubernetes-commit: 3fa7b7824abbf3daec1189b118b91b5bb726958f
This commit is contained in:
committed by
Kubernetes Publisher
parent
670b68600e
commit
cf012f20d0
@@ -34,7 +34,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/pkg/api"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"k8s.io/client-go/pkg/api/v1"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/util/flowcontrol"
|
||||
@@ -245,9 +245,9 @@ func (dynamicCodec) Encode(obj runtime.Object, w io.Writer) error {
|
||||
// ContentConfig returns a restclient.ContentConfig for dynamic types.
|
||||
func ContentConfig() restclient.ContentConfig {
|
||||
var jsonInfo runtime.SerializerInfo
|
||||
// TODO: api.Codecs here should become "pkg/apis/server/scheme" which is the minimal core you need
|
||||
// TODO: scheme.Codecs here should become "pkg/apis/server/scheme" which is the minimal core you need
|
||||
// to talk to a kubernetes server
|
||||
for _, info := range api.Codecs.SupportedMediaTypes() {
|
||||
for _, info := range scheme.Codecs.SupportedMediaTypes() {
|
||||
if info.MediaType == runtime.ContentTypeJSON {
|
||||
jsonInfo = info
|
||||
break
|
||||
@@ -280,10 +280,10 @@ var defaultParameterEncoder runtime.ParameterCodec = parameterCodec{}
|
||||
type versionedParameterEncoderWithV1Fallback struct{}
|
||||
|
||||
func (versionedParameterEncoderWithV1Fallback) EncodeParameters(obj runtime.Object, to schema.GroupVersion) (url.Values, error) {
|
||||
ret, err := api.ParameterCodec.EncodeParameters(obj, to)
|
||||
ret, err := scheme.ParameterCodec.EncodeParameters(obj, to)
|
||||
if err != nil && runtime.IsNotRegisteredError(err) {
|
||||
// fallback to v1
|
||||
return api.ParameterCodec.EncodeParameters(obj, v1.SchemeGroupVersion)
|
||||
return scheme.ParameterCodec.EncodeParameters(obj, v1.SchemeGroupVersion)
|
||||
}
|
||||
return ret, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user