Merge pull request #60201 from sttts/sttts-unstructured-convert-to-version

Automatic merge from submit-queue (batch tested with PRs 60201, 62744). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apimachinery: normal conversion code path for Unstructured in ConvertToVersion

Preparation for https://github.com/kubernetes/kubernetes/pull/60113
This commit is contained in:
Kubernetes Submit Queue
2018-04-18 07:58:15 -07:00
committed by GitHub
7 changed files with 47 additions and 7 deletions

View File

@@ -45,6 +45,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
utilflag "k8s.io/apiserver/pkg/util/flag"
@@ -707,5 +708,6 @@ func InternalVersionDecoder() runtime.Decoder {
}
func InternalVersionJSONEncoder() runtime.Encoder {
return legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.EnabledVersions()...)
encoder := legacyscheme.Codecs.LegacyCodec(legacyscheme.Registry.EnabledVersions()...)
return unstructured.JSONFallbackEncoder{Encoder: encoder}
}