@@ -4,11 +4,12 @@ import (
44 "bytes"
55 "context"
66 "fmt"
7- "github.com/onsi/ginkgo/v2"
87 "os"
98 "os/exec"
109 "time"
1110
11+ "github.com/onsi/ginkgo/v2"
12+
1213 "github.com/loft-sh/devspace/cmd"
1314 "github.com/loft-sh/devspace/cmd/flags"
1415 "github.com/loft-sh/devspace/e2e/framework"
@@ -95,4 +96,49 @@ var _ = DevSpaceDescribe("proxyCommands", func() {
9596 err = <- done
9697 framework .ExpectNoError (err )
9798 })
99+
100+ ginkgo .It ("devspace dev should proxy commands to host machine without /usr/local/bin" , func () {
101+ tempDir , err := framework .CopyToTempDir ("tests/proxycommands/testdata/proxycommands-no-usr-local" )
102+ framework .ExpectNoError (err )
103+ defer framework .CleanupTempDir (initialDir , tempDir )
104+
105+ ns , err := kubeClient .CreateNamespace ("no-usr-local" )
106+ framework .ExpectNoError (err )
107+ defer framework .ExpectDeleteNamespace (kubeClient , ns )
108+
109+ // create a new dev command and start it
110+ done := make (chan error )
111+ cancelCtx , cancel := context .WithCancel (context .Background ())
112+ defer cancel ()
113+
114+ go func () {
115+ defer ginkgo .GinkgoRecover ()
116+
117+ devCmd := & cmd.RunPipelineCmd {
118+ GlobalFlags : & flags.GlobalFlags {
119+ NoWarn : true ,
120+ Namespace : ns ,
121+ },
122+ Pipeline : "dev" ,
123+ Ctx : cancelCtx ,
124+ }
125+
126+ done <- devCmd .RunDefault (f )
127+ }()
128+
129+ // Check that the command is proxied to the host.
130+ var stdout , stderr bytes.Buffer
131+ cmd := exec .Command ("helm" , "version" )
132+ cmd .Stdout = & stdout
133+ cmd .Stderr = & stderr
134+ err = cmd .Run ()
135+ framework .ExpectNoError (err )
136+
137+ framework .ExpectRemoteFileContents ("busybox" , ns , "helm-version.out" , stdout .String ())
138+
139+ cancel ()
140+
141+ err = <- done
142+ framework .ExpectNoError (err )
143+ })
98144})
0 commit comments