diff --git a/pkg/kubernetes/watcher.go b/pkg/kubernetes/watcher.go index 0bdc2d6..80c82d1 100644 --- a/pkg/kubernetes/watcher.go +++ b/pkg/kubernetes/watcher.go @@ -4,7 +4,6 @@ import ( "context" "errors" "regexp" - "strings" "github.com/rs/zerolog/log" v1 "k8s.io/api/core/v1" @@ -64,21 +63,8 @@ func (watcher *Watcher) watchKubesharkConfigMap(ctx context.Context) error { continue } - var oldRegex string - var oldNamespaces []string - if watcher.regex != nil { - oldRegex = watcher.regex.String() - } - oldNamespaces = watcher.namespaces watcher.regex, watcher.namespaces = SyncConfig(event.Object.(*v1.ConfigMap)) - // No change in pod regex or targeted namespaces - if watcher.regex != nil { - if watcher.regex.String() == oldRegex && strings.Join(watcher.namespaces, ",") == strings.Join(oldNamespaces, ",") { - continue - } - } - err = updateCurrentlyTargetedPods(ctx, watcher.clientSet, watcher.regex, watcher.namespaces, watcher.callback) if err != nil { log.Error().Err(err).Send()