cli icon indicating copy to clipboard operation
cli copied to clipboard

Support '!=' operator in filters and record its usage

Open mohammedfuta2000 opened this issue 10 months ago • 1 comments

closes #6021 In Add() (vendor/github.com/docker/docker/api/types/filters/parse.go), we previously assigned args.fields[key][value] = true with "true" being a placeholder.

Now, it holds isEqualOp, a boolean indicating whether the filter uses = (true) or != (false). This enables us to distinguish between inclusion and exclusion filters.

The Set() function (opts/opts.go) has been updated to detect both = and != in filter strings, replacing the previous convention of using a trailing ! to indicate negation.

Update confirmationMessage() function (cli/command/system/prune.go) to include isEqualOp value in print out for prune command.

The daemon is to be updated this issue to support exclusionary filters.

mohammedfuta2000 avatar Apr 24 '25 13:04 mohammedfuta2000

Codecov Report

Attention: Patch coverage is 38.88889% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
opts/opts.go 0.00% 11 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov-commenter avatar Apr 24 '25 14:04 codecov-commenter