Skip to content

Commit b759b00

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#66998 from WanLinghao/more_legacy_clean
Automatic merge from submit-queue. 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>. snip more legacy scheme uses we don't need **What this PR does / why we need it**: snip more legacy scheme uses we don't need ref:kubernetes#66926 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
2 parents d4d0276 + 5db0286 commit b759b00

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pkg/kubectl/cmd/describe_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
"k8s.io/apimachinery/pkg/api/meta"
2626
"k8s.io/client-go/rest/fake"
27-
"k8s.io/kubernetes/pkg/api/legacyscheme"
2827
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
2928
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
3029
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
@@ -108,7 +107,7 @@ func TestDescribeObject(t *testing.T) {
108107
_, _, rc := testData()
109108
tf := cmdtesting.NewTestFactory().WithNamespace("test")
110109
defer tf.Cleanup()
111-
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
110+
codec := scheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
112111

113112
tf.UnstructuredClient = &fake.RESTClient{
114113
NegotiatedSerializer: unstructuredSerializer,
@@ -149,7 +148,7 @@ func TestDescribeListObjects(t *testing.T) {
149148
pods, _, _ := testData()
150149
tf := cmdtesting.NewTestFactory().WithNamespace("test")
151150
defer tf.Cleanup()
152-
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
151+
codec := scheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
153152

154153
tf.UnstructuredClient = &fake.RESTClient{
155154
NegotiatedSerializer: unstructuredSerializer,
@@ -176,7 +175,7 @@ func TestDescribeObjectShowEvents(t *testing.T) {
176175
pods, _, _ := testData()
177176
tf := cmdtesting.NewTestFactory().WithNamespace("test")
178177
defer tf.Cleanup()
179-
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
178+
codec := scheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
180179

181180
tf.UnstructuredClient = &fake.RESTClient{
182181
NegotiatedSerializer: unstructuredSerializer,
@@ -202,7 +201,7 @@ func TestDescribeObjectSkipEvents(t *testing.T) {
202201
pods, _, _ := testData()
203202
tf := cmdtesting.NewTestFactory().WithNamespace("test")
204203
defer tf.Cleanup()
205-
codec := legacyscheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
204+
codec := scheme.Codecs.LegacyCodec(scheme.Scheme.PrioritizedVersionsAllGroups()...)
206205

207206
tf.UnstructuredClient = &fake.RESTClient{
208207
NegotiatedSerializer: unstructuredSerializer,

pkg/kubectl/cmd/rollingupdate.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import (
3232
"k8s.io/apimachinery/pkg/util/intstr"
3333
"k8s.io/client-go/kubernetes"
3434
scaleclient "k8s.io/client-go/scale"
35-
"k8s.io/kubernetes/pkg/api/legacyscheme"
3635
"k8s.io/kubernetes/pkg/kubectl"
3736
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
3837
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
@@ -311,7 +310,7 @@ func (o *RollingUpdateOptions) Run() error {
311310
// than the old rc. This selector is the hash of the rc, with a suffix to provide uniqueness for
312311
// same-image updates.
313312
if len(o.Image) != 0 {
314-
codec := legacyscheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)
313+
codec := scheme.Codecs.LegacyCodec(v1.SchemeGroupVersion)
315314
newName := o.FindNewName(oldRc)
316315
if newRc, err = kubectl.LoadExistingNextReplicationController(coreClient, o.Namespace, newName); err != nil {
317316
return err

0 commit comments

Comments
 (0)