Files
odo/pkg/remotecmd/interface.go
Armel Soro 4bab9285fb Allow to cancel execution of odo dev at any phase (e.g. if build command is taking long) (#6736)
* Add test cases simulating build or run commands that take very long

* Pass a context around to relevant functions and methods

This will allow to handle cancellations and timeouts and deadlines as needed

* Pass the context to Podman exec command too

* fixup! Add test cases simulating build or run commands that take very long
2023-04-20 17:12:28 +00:00

18 lines
905 B
Go

package remotecmd
import "context"
// RemoteProcessHandler is an interface for managing processes that are intended to be executed remotely,
// independently of container orchestrator
type RemoteProcessHandler interface {
// GetProcessInfoForCommand returns information about the process representing the given command.
GetProcessInfoForCommand(ctx context.Context, def CommandDefinition, podName string, containerName string) (RemoteProcessInfo, error)
// StartProcessForCommand starts a process with the provided Devfile command to execute remotely.
StartProcessForCommand(ctx context.Context, def CommandDefinition, podName string, containerName string, outputHandler CommandOutputHandler) error
// StopProcessForCommand stops the process representing the given Devfile command.
StopProcessForCommand(ctx context.Context, def CommandDefinition, podName string, containerName string) error
}