mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +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 (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/docker/docker/api/types/container"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -356,7 +357,7 @@ func (c *Container) Attach() (*exec.Cmd, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Top returns process information
|
// 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{})
|
return c.Client.ContainerTop(context.Background(), c.ID, []string{})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
APIVersion = "1.20"
|
||||||
|
)
|
||||||
|
|
||||||
// DockerCommand is our main git interface
|
// DockerCommand is our main git interface
|
||||||
type DockerCommand struct {
|
type DockerCommand struct {
|
||||||
Log *logrus.Entry
|
Log *logrus.Entry
|
||||||
|
|
@ -61,7 +65,7 @@ func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {
|
||||||
|
|
||||||
// NewDockerCommand it runs git commands
|
// NewDockerCommand it runs git commands
|
||||||
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/docker/docker/api/types/image"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"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
|
// Layer is a layer in an image's history
|
||||||
type Layer struct {
|
type Layer struct {
|
||||||
types.ImageHistory
|
image.HistoryResponseItem
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDisplayStrings returns the array of strings describing the layer
|
// GetDisplayStrings returns the array of strings describing the layer
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/docker/docker/api/types/container"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
|
@ -61,7 +62,7 @@ func (s *Service) Attach() (*exec.Cmd, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Top returns process information
|
// Top returns process information
|
||||||
func (s *Service) Top() (types.ContainerProcessList, error) {
|
func (s *Service) Top() (container.ContainerTopOKBody, error) {
|
||||||
return s.Container.Top()
|
return s.Container.Top()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue