diff --git a/accounts/pkg/command/version.go b/accounts/pkg/command/version.go index f5d222840..1ceb63408 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 5be8ea3d4..10a32c5c5 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 407a04d8b..c5c731e4e 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 a2af36913..82b941ddc 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 25d234cc4..54fbf4beb 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 a361225b6..48626e950 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 b61419f92..23ef96629 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 f655589f2..e76dcc6a9 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 3d3f15e72..81df847f1 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 34dcca193..570fc5271 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 ff2334265..8e89bc107 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 3a17e44b7..16a7bbf86 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 a77dbe3fb..d60735d60 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))