From a1e69c6a5ce07b1c136762626d381cf0c8fa2368 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 06:28:22 +0000 Subject: [PATCH] Bump github.com/go-micro/plugins/v4/registry/consul from 1.2.0 to 1.2.1 Bumps [github.com/go-micro/plugins/v4/registry/consul](https://github.com/go-micro/plugins) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/go-micro/plugins/releases) - [Commits](https://github.com/go-micro/plugins/compare/v4/auth/jwt/v1.2.0...v4/logger/zap/v1.2.1) --- updated-dependencies: - dependency-name: github.com/go-micro/plugins/v4/registry/consul dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../go-micro/plugins/v4/registry/consul/watcher.go | 11 ++++++++++- vendor/modules.txt | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index f392cc529a..3b65932471 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/go-micro/plugins/v4/client/grpc v1.2.0 github.com/go-micro/plugins/v4/events/natsjs v1.2.1 github.com/go-micro/plugins/v4/logger/zerolog v1.2.0 - github.com/go-micro/plugins/v4/registry/consul v1.2.0 + github.com/go-micro/plugins/v4/registry/consul v1.2.1 github.com/go-micro/plugins/v4/registry/etcd v1.2.0 github.com/go-micro/plugins/v4/registry/kubernetes v1.1.2-0.20230605104008-a179a6b8f8e6 github.com/go-micro/plugins/v4/registry/mdns v1.2.0 diff --git a/go.sum b/go.sum index d43af74dbf..ffd617edd9 100644 --- a/go.sum +++ b/go.sum @@ -780,8 +780,8 @@ github.com/go-micro/plugins/v4/events/natsjs v1.2.1 h1:wCq5pyUkHSJ31QAtTLiIRowNM github.com/go-micro/plugins/v4/events/natsjs v1.2.1/go.mod h1:lYuiEYKQTpbE2LA8HEcC8D6kQ29M7ILfEak3dzeucEg= github.com/go-micro/plugins/v4/logger/zerolog v1.2.0 h1:JZ516VQ9zekRoi868XG7x0EWxZ2AMq/euHIBChITsTI= github.com/go-micro/plugins/v4/logger/zerolog v1.2.0/go.mod h1:AieYOIeOxobYa5B8WGEqxXM3Ndi26tDIu9fZ4RYkCvQ= -github.com/go-micro/plugins/v4/registry/consul v1.2.0 h1:nqrTzfWUTWKAy+M+i2FazbHnQn4m77EOtoch57kbCH4= -github.com/go-micro/plugins/v4/registry/consul v1.2.0/go.mod h1:wTat7/K9XQ+i64VbbcMYFcEwipYfSgJM51HcA/sgsM4= +github.com/go-micro/plugins/v4/registry/consul v1.2.1 h1:3wctYMtstwQLCjoJ1HA6mKGGFF1hcdKDv5MzHakB1jE= +github.com/go-micro/plugins/v4/registry/consul v1.2.1/go.mod h1:wTat7/K9XQ+i64VbbcMYFcEwipYfSgJM51HcA/sgsM4= github.com/go-micro/plugins/v4/registry/etcd v1.2.0 h1:tcHlU1GzvX3oZa8WQH8ylMCGie5qD5g98YWTESJjeqQ= github.com/go-micro/plugins/v4/registry/etcd v1.2.0/go.mod h1:CQeTHkjN3xMtIQsynaTTquMz2sHEdsTfRIfFzrX7aug= github.com/go-micro/plugins/v4/registry/kubernetes v1.1.2-0.20230605104008-a179a6b8f8e6 h1:ekJ70Hq3N+Enz71GCubzhzcVuA9jfd1zWuqTXZF+UlU= diff --git a/vendor/github.com/go-micro/plugins/v4/registry/consul/watcher.go b/vendor/github.com/go-micro/plugins/v4/registry/consul/watcher.go index 0e458503d5..133e5c92f3 100644 --- a/vendor/github.com/go-micro/plugins/v4/registry/consul/watcher.go +++ b/vendor/github.com/go-micro/plugins/v4/registry/consul/watcher.go @@ -47,7 +47,7 @@ func newConsulWatcher(cr *consulRegistry, opts ...registry.WatchOption) (registr return nil, err } - wp.Handler = cw.handle + wp.Handler = cw.serviceHandler go wp.RunWithClientAndHclog(cr.Client(), wp.Logger) cw.wp = wp @@ -184,6 +184,15 @@ func (cw *consulWatcher) serviceHandler(idx uint64, data interface{}) { } } + // there are no services in the service, empty all services + if len(rservices) != 0 && serviceName == "" { + for _, services := range rservices { + for _, service := range services { + cw.next <- ®istry.Result{Action: "delete", Service: service} + } + } + } + cw.Lock() cw.services[serviceName] = newServices cw.Unlock() diff --git a/vendor/modules.txt b/vendor/modules.txt index bba17d6599..09557adfce 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -889,7 +889,7 @@ github.com/go-micro/plugins/v4/events/natsjs # github.com/go-micro/plugins/v4/logger/zerolog v1.2.0 ## explicit; go 1.17 github.com/go-micro/plugins/v4/logger/zerolog -# github.com/go-micro/plugins/v4/registry/consul v1.2.0 +# github.com/go-micro/plugins/v4/registry/consul v1.2.1 ## explicit; go 1.17 github.com/go-micro/plugins/v4/registry/consul # github.com/go-micro/plugins/v4/registry/etcd v1.2.0