mirror of
https://github.com/dokku/dokku.git
synced 2026-02-23 19:50:34 +01:00
fix: wrap the TerminalSizeQueue in an adapter
This fixes an issue with the updated interface dropped in ce4d90902a
This commit is contained in:
@@ -489,15 +489,34 @@ func (k KubernetesClient) ExecCommand(ctx context.Context, input ExecCommandInpu
|
||||
}
|
||||
|
||||
return exec.StreamWithContext(ctx, remotecommand.StreamOptions{
|
||||
Stdin: os.Stdin,
|
||||
Stdout: stdout,
|
||||
Stderr: stderr,
|
||||
Tty: actuallyTty,
|
||||
TerminalSizeQueue: sizeQueue,
|
||||
Stdin: os.Stdin,
|
||||
Stdout: stdout,
|
||||
Stderr: stderr,
|
||||
Tty: actuallyTty,
|
||||
TerminalSizeQueue: &terminalSizeQueueAdapter{
|
||||
delegate: sizeQueue,
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// terminalSizeQueueAdapter is an adapter for the terminal size queue to the remotecommand.TerminalSizeQueue interface
|
||||
type terminalSizeQueueAdapter struct {
|
||||
delegate term.TerminalSizeQueue
|
||||
}
|
||||
|
||||
// Next returns the next terminal size
|
||||
func (a *terminalSizeQueueAdapter) Next() *remotecommand.TerminalSize {
|
||||
next := a.delegate.Next()
|
||||
if next == nil {
|
||||
return nil
|
||||
}
|
||||
return &remotecommand.TerminalSize{
|
||||
Width: next.Width,
|
||||
Height: next.Height,
|
||||
}
|
||||
}
|
||||
|
||||
// GetPodLogsInput contains all the information needed to get the logs for a Kubernetes pod
|
||||
type GetLogsInput struct {
|
||||
// Name is the Kubernetes pod name
|
||||
|
||||
Reference in New Issue
Block a user