mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
switch some commands to use its own scheme
This commit is contained in:
@@ -25,9 +25,9 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/client-go/rest/fake"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
|
||||
)
|
||||
|
||||
@@ -44,7 +44,7 @@ func (f *fakePortForwarder) ForwardPorts(method string, url *url.URL, opts PortF
|
||||
}
|
||||
|
||||
func testPortForward(t *testing.T, flags map[string]string, args []string) {
|
||||
version := legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion.Version
|
||||
version := "v1"
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
@@ -70,7 +70,7 @@ func testPortForward(t *testing.T, flags map[string]string, args []string) {
|
||||
var err error
|
||||
f, tf, codec, ns := cmdtesting.NewAPIFactory()
|
||||
tf.Client = &fake.RESTClient{
|
||||
GroupVersion: legacyscheme.Registry.GroupOrDie(api.GroupName).GroupVersion,
|
||||
GroupVersion: schema.GroupVersion{Group: ""},
|
||||
NegotiatedSerializer: ns,
|
||||
Client: fake.CreateHTTPClient(func(req *http.Request) (*http.Response, error) {
|
||||
switch p, m := req.URL.Path, req.Method; {
|
||||
|
||||
Reference in New Issue
Block a user