From 6cbe967c9804202ed3ab4fe2944331dc222bd516 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 9 Oct 2018 19:34:28 -0700 Subject: [PATCH] Add support for k8s 1.12 --- config/context.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/config/context.go b/config/context.go index 223723ef..2edc2f9f 100644 --- a/config/context.go +++ b/config/context.go @@ -5,6 +5,7 @@ import ( "github.com/rancher/norman/controller" "github.com/rancher/norman/event" + "github.com/rancher/norman/objectclient/dynamic" "github.com/rancher/norman/restwatch" "github.com/rancher/norman/signal" "github.com/rancher/norman/store/proxy" @@ -28,7 +29,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/rest" @@ -116,8 +116,7 @@ func NewScaledContext(config rest.Config) (*ScaledContext, error) { dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil { - configConfig := dynamic.ContentConfig() - dynamicConfig.NegotiatedSerializer = configConfig.NegotiatedSerializer + dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer } context.UnversionedClient, err = restwatch.UnversionedRESTClientFor(&dynamicConfig) @@ -289,8 +288,7 @@ func NewManagementContext(config rest.Config) (*ManagementContext, error) { dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil { - configConfig := dynamic.ContentConfig() - dynamicConfig.NegotiatedSerializer = configConfig.NegotiatedSerializer + dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer } context.UnversionedClient, err = restwatch.UnversionedRESTClientFor(&dynamicConfig) @@ -402,8 +400,7 @@ func NewUserContext(scaledContext *ScaledContext, config rest.Config, clusterNam dynamicConfig := config if dynamicConfig.NegotiatedSerializer == nil { - configConfig := dynamic.ContentConfig() - dynamicConfig.NegotiatedSerializer = configConfig.NegotiatedSerializer + dynamicConfig.NegotiatedSerializer = dynamic.NegotiatedSerializer } context.UnversionedClient, err = restwatch.UnversionedRESTClientFor(&dynamicConfig)