mirror of https://github.com/docker/cli.git
Merge pull request #1551 from thaJeztah/fix_filter_panic
Fix panic when pruning images with label-filter
This commit is contained in:
commit
1408a3189f
|
@ -67,8 +67,7 @@ func cloneFilter(args filters.Args) (newArgs filters.Args, err error) {
|
|||
if err != nil {
|
||||
return newArgs, err
|
||||
}
|
||||
err = newArgs.UnmarshalJSON(b)
|
||||
return newArgs, err
|
||||
return filters.FromJSON(string(b))
|
||||
}
|
||||
|
||||
func runPrune(dockerCli command.Cli, options pruneOptions) (spaceReclaimed uint64, output string, err error) {
|
||||
|
|
|
@ -70,6 +70,14 @@ func TestNewPruneCommandSuccess(t *testing.T) {
|
|||
}, nil
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "label-filter",
|
||||
args: []string{"--force", "--filter", "label=foobar"},
|
||||
imagesPruneFunc: func(pruneFilter filters.Args) (types.ImagesPruneReport, error) {
|
||||
assert.Check(t, is.Equal("foobar", pruneFilter.Get("label")[0]))
|
||||
return types.ImagesPruneReport{}, nil
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "force-untagged",
|
||||
args: []string{"--force"},
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Total reclaimed space: 0B
|
Loading…
Reference in New Issue