Skip to content

Commit 4e20ac7

Browse files
committed
Removes call to SetDefaultScheme, which is not thread safe.
Signed-off-by: Ryan Swanson <[email protected]>
1 parent 156652d commit 4e20ac7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+346
-318
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ require (
3232
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
3333
github.com/loft-sh/go-github-selfupdate v1.0.0
3434
github.com/loft-sh/loft-util v0.0.9-alpha
35-
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee
35+
github.com/loft-sh/notify v0.0.0-20250811133046-d79ab32e79b2
3636
github.com/loft-sh/programming-language-detection v0.0.5
3737
github.com/loft-sh/utils v0.0.16
3838
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
@@ -195,7 +195,7 @@ require (
195195
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca // indirect
196196
golang.org/x/oauth2 v0.30.0 // indirect
197197
golang.org/x/sync v0.16.0 // indirect
198-
golang.org/x/sys v0.34.0 // indirect
198+
golang.org/x/sys v0.35.0 // indirect
199199
golang.org/x/term v0.33.0 // indirect
200200
golang.org/x/time v0.3.0 // indirect
201201
golang.org/x/tools v0.34.0 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ github.com/loft-sh/go-github-selfupdate v1.0.0 h1:YS8iSsIWXw3BygBdPK2xDO4K84XYu2
337337
github.com/loft-sh/go-github-selfupdate v1.0.0/go.mod h1:LDkR6J2QpqQLIMcYvNaSinVwvjPAkg8278oZBPGnrb8=
338338
github.com/loft-sh/loft-util v0.0.9-alpha h1:kGcyTQWxWHWy7bbjhS8Hsq/JRdlSztAU++anV6P+sqk=
339339
github.com/loft-sh/loft-util v0.0.9-alpha/go.mod h1:lsjG5Exh5iEf7Z/87nqwkxx3GRQTizFRLGuS1knF6Cg=
340-
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee h1:hZ79+pKEbCBrH1dVmgZ4jtFrrDPxgM4zqEP1lHlSnvI=
341-
github.com/loft-sh/notify v0.0.0-20210827094439-0720dcc7feee/go.mod h1:pq83B8lgfCY7tKdegTTXU6DZxGQkcWMowUTOTpTQmqk=
340+
github.com/loft-sh/notify v0.0.0-20250811133046-d79ab32e79b2 h1:N3uX7AwEUUwBxt4rgvNIaYzb7cUvxDfjp7tD68yiavo=
341+
github.com/loft-sh/notify v0.0.0-20250811133046-d79ab32e79b2/go.mod h1:pq83B8lgfCY7tKdegTTXU6DZxGQkcWMowUTOTpTQmqk=
342342
github.com/loft-sh/programming-language-detection v0.0.5 h1:XiWlxtrf4t6Z7SQiob0JMKaCeMHCP3kWhB80wLt+EMY=
343343
github.com/loft-sh/programming-language-detection v0.0.5/go.mod h1:QGPQGKr9q1+rQS4OyisS5CPGY1a76SdNaZuk9oy+2cE=
344344
github.com/loft-sh/utils v0.0.16 h1:XnD6Sb6gRWIHgM34U94dHcQ5MtxN5kAGZQ5eddAxC+c=
@@ -680,8 +680,8 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
680680
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
681681
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
682682
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
683-
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
684-
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
683+
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
684+
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
685685
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
686686
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
687687
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=

helper/util/conn.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,20 @@ import (
44
"context"
55
"io"
66
"net"
7-
7+
88
"google.golang.org/grpc"
99
"google.golang.org/grpc/credentials/insecure"
10-
"google.golang.org/grpc/resolver"
1110
)
1211

1312
// NewClientConnection creates a new client connection for the given reader and writer
1413
func NewClientConnection(reader io.Reader, writer io.Writer) (*grpc.ClientConn, error) {
1514
pipe := NewStdStreamJoint(reader, writer, false)
16-
17-
resolver.SetDefaultScheme("passthrough")
15+
1816
// Set up a connection to the server.
19-
return grpc.NewClient("",
17+
return grpc.NewClient("passthrough:///",
2018
grpc.WithTransportCredentials(insecure.NewCredentials()),
2119
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) {
2220
return pipe, nil
2321
}),
24-
grpc.WithLocalDNSResolution(),
25-
grpc.WithDefaultCallOptions())
22+
grpc.WithLocalDNSResolution())
2623
}

pkg/devspace/services/sync/controller.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"bytes"
66
"context"
77
"fmt"
8-
"github.com/loft-sh/devspace/pkg/util/tomb"
9-
"github.com/mgutz/ansi"
108
"io"
119
"os"
1210
"path"
@@ -15,6 +13,9 @@ import (
1513
"strings"
1614
"time"
1715

16+
"github.com/loft-sh/devspace/pkg/util/tomb"
17+
"github.com/mgutz/ansi"
18+
1819
"github.com/loft-sh/devspace/pkg/devspace/kubectl/selector"
1920
kerrors "k8s.io/apimachinery/pkg/api/errors"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -267,9 +268,7 @@ func PrintPodError(ctx context.Context, kubeClient kubectl.Client, pod *v1.Pod,
267268
}
268269

269270
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) {
270-
var (
271-
syncConfig = options.SyncConfig
272-
)
271+
syncConfig := options.SyncConfig
273272

274273
container, err := options.Selector.SelectSingleContainer(ctx.Context(), ctx.KubeClient(), ctx.Log())
275274
if err != nil {
@@ -501,7 +500,7 @@ func (c *controller) initClient(ctx devspacecontext.Context, pod *v1.Pod, arch,
501500
go func() {
502501
err := StartStream(ctx.Context(), ctx.KubeClient(), pod, container, upstreamArgs, upStdinReader, upStdoutWriter, true, options.Log)
503502
if err != nil {
504-
syncClient.Stop(errors.Errorf("Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err))
503+
syncClient.Stop(errors.Errorf("Upstream Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err))
505504
}
506505
}()
507506

@@ -529,7 +528,7 @@ func (c *controller) initClient(ctx devspacecontext.Context, pod *v1.Pod, arch,
529528
go func() {
530529
err := StartStream(ctx.Context(), ctx.KubeClient(), pod, container, downstreamArgs, downStdinReader, downStdoutWriter, true, options.Log)
531530
if err != nil {
532-
syncClient.Stop(errors.Errorf("Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err))
531+
syncClient.Stop(errors.Errorf("Downstream Sync - connection lost to pod %s/%s: %v", pod.Namespace, pod.Name, err))
533532
}
534533
}()
535534

vendor/github.com/loft-sh/notify/watcher_fsevents_cgo.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/mkerrors.sh

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/golang.org/x/sys/unix/syscall_darwin.go

Lines changed: 1 addition & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)