From 8a8aa2dc523e490c3262bf1b64b68e3a3dd18fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 22 Feb 2021 15:08:50 +0000 Subject: [PATCH] use micre v3 registry interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- accounts/pkg/command/version.go | 2 +- idp/pkg/command/version.go | 2 +- ocis-pkg/service/grpc/service.go | 2 +- ocis-pkg/service/http/service.go | 2 +- ocis/pkg/command/root.go | 2 +- ocis/pkg/command/version.go | 2 +- ocs/pkg/command/version.go | 2 +- proxy/pkg/command/version.go | 2 +- settings/pkg/command/version.go | 2 +- storage/pkg/service/external/external.go | 6 +++--- store/pkg/command/version.go | 2 +- thumbnails/pkg/command/version.go | 2 +- webdav/pkg/command/version.go | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/accounts/pkg/command/version.go b/accounts/pkg/command/version.go index f5d222840b..1ceb634082 100644 --- a/accounts/pkg/command/version.go +++ b/accounts/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListAccountsWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Server.Name) if err != nil { fmt.Println(fmt.Errorf("could not get accounts services from the registry: %v", err)) diff --git a/idp/pkg/command/version.go b/idp/pkg/command/version.go index 5be8ea3d46..10a32c5c59 100644 --- a/idp/pkg/command/version.go +++ b/idp/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListIDPWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get idp services from the registry: %v", err)) diff --git a/ocis-pkg/service/grpc/service.go b/ocis-pkg/service/grpc/service.go index 407a04d8bb..c5c731e4e5 100644 --- a/ocis-pkg/service/grpc/service.go +++ b/ocis-pkg/service/grpc/service.go @@ -39,7 +39,7 @@ func NewService(opts ...Option) Service { micro.Version(sopts.Version), micro.Context(sopts.Context), micro.Flags(sopts.Flags...), - micro.Registry(*registry.GetRegistry()), + micro.Registry(registry.GetRegistry()), micro.RegisterTTL(time.Second * 30), micro.RegisterInterval(time.Second * 10), micro.WrapHandler(prometheus.NewHandlerWrapper()), diff --git a/ocis-pkg/service/http/service.go b/ocis-pkg/service/http/service.go index a2af36913d..82b941ddc6 100644 --- a/ocis-pkg/service/http/service.go +++ b/ocis-pkg/service/http/service.go @@ -32,7 +32,7 @@ func NewService(opts ...Option) Service { micro.Version(sopts.Version), micro.Context(sopts.Context), micro.Flags(sopts.Flags...), - micro.Registry(*registry.GetRegistry()), + micro.Registry(registry.GetRegistry()), micro.RegisterTTL(time.Second * 30), micro.RegisterInterval(time.Second * 10), } diff --git a/ocis/pkg/command/root.go b/ocis/pkg/command/root.go index 25d234cc45..54fbf4beb1 100644 --- a/ocis/pkg/command/root.go +++ b/ocis/pkg/command/root.go @@ -44,7 +44,7 @@ func Execute() error { ) } - //r := *registry.GetRegistry() + //r := registry.GetRegistry() //opts := micro.Options{ // Registry: r, diff --git a/ocis/pkg/command/version.go b/ocis/pkg/command/version.go index a361225b6d..48626e950d 100644 --- a/ocis/pkg/command/version.go +++ b/ocis/pkg/command/version.go @@ -19,7 +19,7 @@ func VersionCommand(cfg *config.Config) *cli.Command { Usage: "Lists running services with version", Category: "Runtime", Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() serviceList, err := reg.ListServices() if err != nil { fmt.Println(fmt.Errorf("could not list services: %v", err)) diff --git a/ocs/pkg/command/version.go b/ocs/pkg/command/version.go index b61419f920..23ef966292 100644 --- a/ocs/pkg/command/version.go +++ b/ocs/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListOcsWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get ocs services from the registry: %v", err)) diff --git a/proxy/pkg/command/version.go b/proxy/pkg/command/version.go index f655589f2b..e76dcc6a96 100644 --- a/proxy/pkg/command/version.go +++ b/proxy/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListProxyWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get proxy services from the registry: %v", err)) diff --git a/settings/pkg/command/version.go b/settings/pkg/command/version.go index 3d3f15e726..81df847f1c 100644 --- a/settings/pkg/command/version.go +++ b/settings/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListSettingsWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get settings services from the registry: %v", err)) diff --git a/storage/pkg/service/external/external.go b/storage/pkg/service/external/external.go index 34dcca193d..570fc52719 100644 --- a/storage/pkg/service/external/external.go +++ b/storage/pkg/service/external/external.go @@ -19,14 +19,14 @@ func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, log Address: addr, Metadata: make(map[string]string), } + r := oregistry.GetRegistry() + node.Metadata["broker"] = broker.String() - node.Metadata["registry"] = registry.String() + node.Metadata["registry"] = r.String() node.Metadata["server"] = "grpc" node.Metadata["transport"] = "grpc" node.Metadata["protocol"] = "grpc" - r := *oregistry.GetRegistry() - service := ®istry.Service{ Name: serviceID, Version: "", diff --git a/store/pkg/command/version.go b/store/pkg/command/version.go index ff23342650..8e89bc107e 100644 --- a/store/pkg/command/version.go +++ b/store/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListStoreWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get store services from the registry: %v", err)) diff --git a/thumbnails/pkg/command/version.go b/thumbnails/pkg/command/version.go index 3a17e44b7f..16a7bbf86f 100644 --- a/thumbnails/pkg/command/version.go +++ b/thumbnails/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListThumbnailsWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Server.Namespace + "." + cfg.Server.Name) if err != nil { fmt.Println(fmt.Errorf("could not get thumbnails services from the registry: %v", err)) diff --git a/webdav/pkg/command/version.go b/webdav/pkg/command/version.go index a77dbe3fb5..d60735d60e 100644 --- a/webdav/pkg/command/version.go +++ b/webdav/pkg/command/version.go @@ -19,7 +19,7 @@ func PrintVersion(cfg *config.Config) *cli.Command { Usage: "Print the versions of the running instances", Flags: flagset.ListWebdavWithConfig(cfg), Action: func(c *cli.Context) error { - reg := *registry.GetRegistry() + reg := registry.GetRegistry() services, err := reg.GetService(cfg.Service.Namespace + "." + cfg.Service.Name) if err != nil { fmt.Println(fmt.Errorf("could not get webdav services from the registry: %v", err))