From 2f4a3f827fec1196e9edc681c229f500db9741ba Mon Sep 17 00:00:00 2001 From: kongfei Date: Wed, 15 Mar 2023 19:12:08 +0800 Subject: [PATCH] delete redudant code --- logs/util/containers/filter.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/logs/util/containers/filter.go b/logs/util/containers/filter.go index 19220728..e61f8c00 100644 --- a/logs/util/containers/filter.go +++ b/logs/util/containers/filter.go @@ -275,14 +275,12 @@ func (cf Filter) IsExcluded(containerName, containerImage, podNamespace string) // Check if excludeListed for _, r := range cf.ImageExcludeList { - if r.MatchString(containerImage) { - if coreconfig.Config.DebugMode { - log.Printf("D!, exclude item :%+v, container image:%s, true\n", r, containerImage) - } - return true - } + match := r.MatchString(containerImage) if coreconfig.Config.DebugMode { - log.Printf("D! exclude item :%+v, container image:%s, false", r, containerImage) + log.Printf("D!, exclude item :%+v, container image:%s, %t\n", r, containerImage, match) + } + if match { + return true } } for _, r := range cf.NameExcludeList {