mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 07:11:01 +00:00
adjust code to newer API
This commit is contained in:
parent
277681a0dc
commit
bb319ddb59
4 changed files with 11 additions and 4 deletions
|
|
@ -2,6 +2,7 @@ package commands
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -356,7 +357,7 @@ func (c *Container) Attach() (*exec.Cmd, error) {
|
|||
}
|
||||
|
||||
// Top returns process information
|
||||
func (c *Container) Top() (types.ContainerProcessList, error) {
|
||||
func (c *Container) Top() (container.ContainerTopOKBody, error) {
|
||||
return c.Client.ContainerTop(context.Background(), c.ID, []string{})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
APIVersion = "1.20"
|
||||
)
|
||||
|
||||
// DockerCommand is our main git interface
|
||||
type DockerCommand struct {
|
||||
Log *logrus.Entry
|
||||
|
|
@ -61,7 +65,7 @@ func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {
|
|||
|
||||
// NewDockerCommand it runs git commands
|
||||
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
|
||||
cli, err := client.NewEnvClient()
|
||||
cli, err := client.NewClientWithOpts(client.WithVersion(APIVersion))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package commands
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
|
|
@ -41,7 +42,7 @@ func (i *Image) Remove(options types.ImageRemoveOptions) error {
|
|||
|
||||
// Layer is a layer in an image's history
|
||||
type Layer struct {
|
||||
types.ImageHistory
|
||||
image.HistoryResponseItem
|
||||
}
|
||||
|
||||
// GetDisplayStrings returns the array of strings describing the layer
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package commands
|
||||
|
||||
import (
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"os/exec"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
|
|
@ -61,7 +62,7 @@ func (s *Service) Attach() (*exec.Cmd, error) {
|
|||
}
|
||||
|
||||
// Top returns process information
|
||||
func (s *Service) Top() (types.ContainerProcessList, error) {
|
||||
func (s *Service) Top() (container.ContainerTopOKBody, error) {
|
||||
return s.Container.Top()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue