Skip to content
Snippets Groups Projects
Commit 2161a081 authored by Murat Kabilov's avatar Murat Kabilov
Browse files

use scheme package instead of api

parent 129bcd7b
Branches feature/dynamic-client
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api" "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd"
...@@ -41,7 +41,7 @@ func ResourceNotFound(err error) bool { ...@@ -41,7 +41,7 @@ func ResourceNotFound(err error) bool {
func KubernetesRestClient(c *rest.Config) (rest.Interface, error) { func KubernetesRestClient(c *rest.Config) (rest.Interface, error) {
c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion} c.GroupVersion = &schema.GroupVersion{Version: constants.K8sVersion}
c.APIPath = constants.K8sAPIPath c.APIPath = constants.K8sAPIPath
c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} c.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
schemeBuilder := runtime.NewSchemeBuilder( schemeBuilder := runtime.NewSchemeBuilder(
func(scheme *runtime.Scheme) error { func(scheme *runtime.Scheme) error {
...@@ -57,7 +57,7 @@ func KubernetesRestClient(c *rest.Config) (rest.Interface, error) { ...@@ -57,7 +57,7 @@ func KubernetesRestClient(c *rest.Config) (rest.Interface, error) {
) )
return nil return nil
}) })
if err := schemeBuilder.AddToScheme(api.Scheme); err != nil { if err := schemeBuilder.AddToScheme(scheme.Scheme); err != nil {
return nil, fmt.Errorf("could not apply functions to register PostgreSQL TPR type: %v", err) return nil, fmt.Errorf("could not apply functions to register PostgreSQL TPR type: %v", err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment