Extend adaptImage function with annotations case

Extend the adaptImage function with a case for handling the annotations
so they can be used in the filter adaptors for fieldpaths.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-03-22 14:56:23 -04:00
parent 09cf2a629b
commit 5d50b9c2bb

View File

@ -51,6 +51,8 @@ func adaptImage(o interface{}) filters.Adaptor {
return checkMap(fieldpath[1:], obj.Labels) return checkMap(fieldpath[1:], obj.Labels)
// TODO(stevvooe): Greater/Less than filters would be awesome for // TODO(stevvooe): Greater/Less than filters would be awesome for
// size. Let's do it! // size. Let's do it!
case "annotations":
return checkMap(fieldpath[1:], obj.Target.Annotations)
} }
return "", false return "", false