浏览代码

Merge pull request #35896 from thaJeztah/fix-namespace-filtering

Fix event filter filtering on "or"
Lei Jitang 7 年之前
父节点
当前提交
431d3d6756
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      libcontainerd/client_daemon.go

+ 3 - 2
libcontainerd/client_daemon.go

@@ -715,8 +715,9 @@ func (c *client) processEventStream(ctx context.Context) {
 
 	eventStream, err = c.remote.EventService().Subscribe(ctx, &eventsapi.SubscribeRequest{
 		Filters: []string{
-			"namespace==" + c.namespace,
-			"topic~=/tasks/",
+			// Filter on both namespace *and* topic. To create an "and" filter,
+			// this must be a single, comma-separated string
+			"namespace==" + c.namespace + ",topic~=|^/tasks/|",
 		},
 	}, grpc.FailFast(false))
 	if err != nil {