diff --git a/helper/util/conn.go b/helper/util/conn.go index d5629ad916..784993fa11 100644 --- a/helper/util/conn.go +++ b/helper/util/conn.go @@ -4,23 +4,20 @@ import ( "context" "io" "net" - + "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/resolver" ) // NewClientConnection creates a new client connection for the given reader and writer func NewClientConnection(reader io.Reader, writer io.Writer) (*grpc.ClientConn, error) { pipe := NewStdStreamJoint(reader, writer, false) - - resolver.SetDefaultScheme("passthrough") + // Set up a connection to the server. - return grpc.NewClient("", + return grpc.NewClient("passthrough:///", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { return pipe, nil }), - grpc.WithLocalDNSResolution(), - grpc.WithDefaultCallOptions()) + grpc.WithLocalDNSResolution()) } diff --git a/pkg/devspace/services/sync/controller.go b/pkg/devspace/services/sync/controller.go index 50d922a80c..12ab892802 100644 --- a/pkg/devspace/services/sync/controller.go +++ b/pkg/devspace/services/sync/controller.go @@ -5,8 +5,6 @@ import ( "bytes" "context" "fmt" - "github.com/loft-sh/devspace/pkg/util/tomb" - "github.com/mgutz/ansi" "io" "os" "path" @@ -15,6 +13,9 @@ import ( "strings" "time" + "github.com/loft-sh/devspace/pkg/util/tomb" + "github.com/mgutz/ansi" + "github.com/loft-sh/devspace/pkg/devspace/kubectl/selector" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -267,9 +268,7 @@ func PrintPodError(ctx context.Context, kubeClient kubectl.Client, pod *v1.Pod, } func (c *controller) startSync(ctx devspacecontext.Context, options *Options, onInitUploadDone chan struct{}, onInitDownloadDone chan struct{}, onDone chan struct{}, onError chan error) (*sync.Sync, *selector.SelectedPodContainer, error) { - var ( - syncConfig = options.SyncConfig - ) + syncConfig := options.SyncConfig container, err := options.Selector.SelectSingleContainer(ctx.Context(), ctx.KubeClient(), ctx.Log()) if err != nil { @@ -501,7 +500,7 @@ func (c *controller) initClient(ctx devspacecontext.Context, pod *v1.Pod, arch, go func() { err := StartStream(ctx.Context(), ctx.KubeClient(), pod, container, upstreamArgs, upStdinReader, upStdoutWriter, true, options.Log) if err != nil { - syncClient.Stop(errors.Errorf("Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err)) + syncClient.Stop(errors.Errorf("Upstream Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err)) } }() @@ -529,7 +528,7 @@ func (c *controller) initClient(ctx devspacecontext.Context, pod *v1.Pod, arch, go func() { err := StartStream(ctx.Context(), ctx.KubeClient(), pod, container, downstreamArgs, downStdinReader, downStdoutWriter, true, options.Log) if err != nil { - syncClient.Stop(errors.Errorf("Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err)) + syncClient.Stop(errors.Errorf("Downstream Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err)) } }()