From fc8f0916a582aa39a274950eb105ca4d8e889aa5 Mon Sep 17 00:00:00 2001 From: Murat Kabilov Date: Mon, 24 Jul 2017 19:45:17 +0200 Subject: [PATCH] fix exec --- pkg/cluster/exec.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/cluster/exec.go b/pkg/cluster/exec.go index c4874d5ee..50eba794f 100644 --- a/pkg/cluster/exec.go +++ b/pkg/cluster/exec.go @@ -6,7 +6,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" - "k8s.io/client-go/pkg/api" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/tools/remotecommand" "github.com/zalando-incubator/postgres-operator/pkg/spec" @@ -27,17 +28,17 @@ func (c *Cluster) ExecCommand(podName *spec.NamespacedName, command ...string) ( return "", fmt.Errorf("could not determine which container to use") } - req := c.RestClient.Post(). + req := c.KubeClient.CoreV1().RESTClient().Post(). Resource("pods"). Name(podName.Name). Namespace(podName.Namespace). SubResource("exec") - req.VersionedParams(&api.PodExecOptions{ + req.VersionedParams(&v1.PodExecOptions{ Container: pod.Spec.Containers[0].Name, Command: command, Stdout: true, Stderr: true, - }, api.ParameterCodec) + }, scheme.ParameterCodec) exec, err := remotecommand.NewExecutor(c.RestConfig, "POST", req.URL()) if err != nil {