mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
drivers: implement streaming exec for executor based drivers
These simply delegate call to backend executor.
This commit is contained in:
@@ -554,6 +554,25 @@ func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*
|
||||
}, nil
|
||||
}
|
||||
|
||||
var _ drivers.ExecTaskStreamingRawDriver = (*Driver)(nil)
|
||||
|
||||
func (d *Driver) ExecTaskStreamingRaw(ctx context.Context,
|
||||
taskID string,
|
||||
command []string,
|
||||
tty bool,
|
||||
stream drivers.ExecTaskStream) error {
|
||||
|
||||
if len(command) == 0 {
|
||||
return fmt.Errorf("error cmd must have atleast one value")
|
||||
}
|
||||
handle, ok := d.tasks.Get(taskID)
|
||||
if !ok {
|
||||
return drivers.ErrTaskNotFound
|
||||
}
|
||||
|
||||
return handle.exec.ExecStreaming(ctx, command, tty, stream)
|
||||
}
|
||||
|
||||
// GetAbsolutePath returns the absolute path of the passed binary by resolving
|
||||
// it in the path and following symlinks.
|
||||
func GetAbsolutePath(bin string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user