MCPcopy
hub / github.com/nektos/act / NewDockerVolumeRemoveExecutor

Function NewDockerVolumeRemoveExecutor

pkg/container/docker_volume.go:12–34  ·  view source on GitHub ↗
(volumeName string, force bool)

Source from the content-addressed store, hash-verified

10)
11
12func NewDockerVolumeRemoveExecutor(volumeName string, force bool) common.Executor {
13 return func(ctx context.Context) error {
14 cli, err := GetDockerClient(ctx)
15 if err != nil {
16 return err
17 }
18 defer cli.Close()
19
20 list, err := cli.VolumeList(ctx, client.VolumeListOptions{})
21 if err != nil {
22 return err
23 }
24
25 for _, vol := range list.Items {
26 if vol.Name == volumeName {
27 return removeExecutor(volumeName, force)(ctx)
28 }
29 }
30
31 // Volume not found - do nothing
32 return nil
33 }
34}
35
36func removeExecutor(volume string, force bool) common.Executor {
37 return func(ctx context.Context) error {

Callers 1

startJobContainerMethod · 0.92

Calls 3

GetDockerClientFunction · 0.85
removeExecutorFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…