Skip to content

Commit

Permalink
Merge pull request #724 from loft-sh/revert-704-przemekbialon/eng-204…
Browse files Browse the repository at this point in the history
…3-ssh-provider-should-fail-early-on-noexec-filesystem

Revert "fail fast if mounted filesystem for agent is noexec"
  • Loading branch information
FabianKramm authored Oct 4, 2023
2 parents d287fd3 + d9243d2 commit fefd303
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
5 changes: 0 additions & 5 deletions pkg/agent/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ func InjectAgentAndExecute(
log,
)
if err != nil {
// noexec filesystem - no need to retry
if errors.Is(err, inject.ErrNoExecFilesystem) {
return err
}

if time.Since(now) > waitForInstanceConnectionTimeout {
return errors.Wrap(err, "timeout waiting for instance connection")
} else if wasExecuted {
Expand Down
15 changes: 0 additions & 15 deletions pkg/inject/filesystem_linux.go

This file was deleted.

7 changes: 0 additions & 7 deletions pkg/inject/filesystem_other.go

This file was deleted.

19 changes: 0 additions & 19 deletions pkg/inject/inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@ type injectResult struct {
err error
}

type NoexecFilesystemError struct {
msg string
}

func (e NoexecFilesystemError) Error() string {
return e.msg
}

var ErrNoExecFilesystem = NoexecFilesystemError{msg: "filesystem is noexec"}

func InjectAndExecute(
ctx context.Context,
exec ExecFunc,
Expand Down Expand Up @@ -75,15 +65,6 @@ func InjectAndExecute(
return true, err
}

log.Debugf("ensure agent path's filesystem is not noexec")
noExec, err := isNoExec(path.Dir(remotePath))
if err != nil {
return false, perrors.Wrapf(err, "check if filesystem is noexec")
}
if noExec {
return false, ErrNoExecFilesystem
}

log.Debugf("execute inject script")
if preferDownload {
log.Debugf("download agent from %s", downloadBase)
Expand Down

0 comments on commit fefd303

Please sign in to comment.