Merge pull request #40 from andyz-dev/reclaim-volumes
[Enhancement] Automatically reclaim k3s container volumes after a cluster is deleted
This commit is contained in:
commit
62f7071ee5
@ -196,7 +196,13 @@ func removeContainer(ID string) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("ERROR: couldn't create docker client\n%+v", err)
|
||||
}
|
||||
if err := docker.ContainerRemove(ctx, ID, types.ContainerRemoveOptions{Force: true}); err != nil {
|
||||
|
||||
options := types.ContainerRemoveOptions{
|
||||
RemoveVolumes: true,
|
||||
Force:true,
|
||||
}
|
||||
|
||||
if err := docker.ContainerRemove(ctx, ID, options); err != nil {
|
||||
return fmt.Errorf("FAILURE: couldn't delete container [%s] -> %+v", ID, err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user