go.mod: github.com/docker/docker, docker/cli v26.1.4 · jesseduffield/lazydocker@2d16389 (original) (raw)
`@@ -5,7 +5,7 @@ import (
`
5
5
`"strings"
`
6
6
`"time"
`
7
7
``
8
``
`-
dockerTypes "github.com/docker/docker/api/types"
`
``
8
`+
"github.com/docker/docker/api/types/image"
`
9
9
`"github.com/fatih/color"
`
10
10
`"github.com/jesseduffield/gocui"
`
11
11
`"github.com/jesseduffield/lazydocker/pkg/commands"
`
`@@ -123,37 +123,37 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
`
123
123
`type removeImageOption struct {
`
124
124
`description string
`
125
125
`command string
`
126
``
`-
configOptions dockerTypes.ImageRemoveOptions
`
``
126
`+
configOptions image.RemoveOptions
`
127
127
` }
`
128
128
``
129
``
`-
image, err := gui.Panels.Images.GetSelectedItem()
`
``
129
`+
img, err := gui.Panels.Images.GetSelectedItem()
`
130
130
`if err != nil {
`
131
131
`return nil
`
132
132
` }
`
133
133
``
134
``
`-
shortSha := image.ID[7:17]
`
``
134
`+
shortSha := img.ID[7:17]
`
135
135
``
136
136
`// TODO: have a way of toggling in a menu instead of showing each permutation as a separate menu item
`
137
137
`options := []*removeImageOption{
`
138
138
` {
`
139
139
`description: gui.Tr.Remove,
`
140
140
`command: "docker image rm " + shortSha,
`
141
``
`-
configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: true, Force: false},
`
``
141
`+
configOptions: image.RemoveOptions{PruneChildren: true, Force: false},
`
142
142
` },
`
143
143
` {
`
144
144
`description: gui.Tr.RemoveWithoutPrune,
`
145
145
`command: "docker image rm --no-prune " + shortSha,
`
146
``
`-
configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: false, Force: false},
`
``
146
`+
configOptions: image.RemoveOptions{PruneChildren: false, Force: false},
`
147
147
` },
`
148
148
` {
`
149
149
`description: gui.Tr.RemoveWithForce,
`
150
150
`command: "docker image rm --force " + shortSha,
`
151
``
`-
configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: true, Force: true},
`
``
151
`+
configOptions: image.RemoveOptions{PruneChildren: true, Force: true},
`
152
152
` },
`
153
153
` {
`
154
154
`description: gui.Tr.RemoveWithoutPruneWithForce,
`
155
155
`command: "docker image rm --no-prune --force " + shortSha,
`
156
``
`-
configOptions: dockerTypes.ImageRemoveOptions{PruneChildren: false, Force: true},
`
``
156
`+
configOptions: image.RemoveOptions{PruneChildren: false, Force: true},
`
157
157
` },
`
158
158
` }
`
159
159
``
`@@ -164,7 +164,7 @@ func (gui *Gui) handleImagesRemoveMenu(g *gocui.Gui, v *gocui.View) error {
`
164
164
`color.New(color.FgRed).Sprint(option.command),
`
165
165
` },
`
166
166
`OnPress: func() error {
`
167
``
`-
if err := image.Remove(option.configOptions); err != nil {
`
``
167
`+
if err := img.Remove(option.configOptions); err != nil {
`
168
168
`return gui.createErrorPanel(err.Error())
`
169
169
` }
`
170
170
``
`@@ -192,13 +192,13 @@ func (gui *Gui) handlePruneImages() error {
`
192
192
`}
`
193
193
``
194
194
`func (gui *Gui) handleImagesCustomCommand(g *gocui.Gui, v *gocui.View) error {
`
195
``
`-
image, err := gui.Panels.Images.GetSelectedItem()
`
``
195
`+
img, err := gui.Panels.Images.GetSelectedItem()
`
196
196
`if err != nil {
`
197
197
`return nil
`
198
198
` }
`
199
199
``
200
200
`commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
`
201
``
`-
Image: image,
`
``
201
`+
Image: img,
`
202
202
` })
`
203
203
``
204
204
`customCommands := gui.Config.UserConfig.CustomCommands.Images
`