Skip to content

Commit

Permalink
automatically enable SSH Exec mode for remote (#864)
Browse files Browse the repository at this point in the history
Signed-off-by: Ramiro Berrelleza <rberrelleza@gmail.com>
  • Loading branch information
rberrelleza committed May 6, 2020
1 parent 7f45b09 commit c432046
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func executeExec(ctx context.Context, dev *model.Dev, args []string) error {
wrapped := []string{"sh", "-c"}
wrapped = append(wrapped, args...)

if dev.ExecuteOverSSHEnabled() {
if dev.ExecuteOverSSHEnabled() || dev.RemoteModeEnabled() {
log.Infof("executing remote command over SSH")
return ssh.Exec(ctx, dev.RemotePort, true, os.Stdin, os.Stdout, os.Stderr, wrapped)
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (up *UpContext) Activate(autoDeploy, build, resetSyncthing bool) {
}

if err := createPIDFile(up.Dev.Namespace, up.Dev.Name); err != nil {
log.Infof("failed to create pid file for %s - %s", up.Dev.Namespace, up.Dev.Name)
log.Infof("failed to create pid file for %s - %s: %s", up.Dev.Namespace, up.Dev.Name, err)
up.Exit <- fmt.Errorf("couldn't create pid file for %s - %s", up.Dev.Namespace, up.Dev.Name)
return
}
Expand Down Expand Up @@ -579,7 +579,7 @@ func (up *UpContext) devMode(d *appsv1.Deployment, create bool) error {
}

func (up *UpContext) forwards() error {
if up.Dev.ExecuteOverSSHEnabled() {
if up.Dev.ExecuteOverSSHEnabled() || up.Dev.RemoteModeEnabled() {
return up.sshForwards()
}

Expand Down Expand Up @@ -722,7 +722,7 @@ func (up *UpContext) startSyncthing(resetSyncthing bool) error {
return err
}

return up.Sy.WaitForScanning(up.Context, up.Dev, false);
return up.Sy.WaitForScanning(up.Context, up.Dev, false)

}

Expand Down Expand Up @@ -811,7 +811,7 @@ func (up *UpContext) runCommand() error {
log.Infof("starting remote command")
up.updateStateFile(ready)

if up.Dev.ExecuteOverSSHEnabled() {
if up.Dev.ExecuteOverSSHEnabled() || up.Dev.RemoteModeEnabled() {
return ssh.Exec(up.Context, up.Dev.RemotePort, true, os.Stdin, os.Stdout, os.Stderr, up.Dev.Command)
}

Expand Down

0 comments on commit c432046

Please sign in to comment.