remove version from service config

This commit is contained in:
Willy Kloucek
2022-01-03 16:24:39 +01:00
parent 55bf175bea
commit 3d4df5796a
40 changed files with 70 additions and 58 deletions
+2 -1
View File
@@ -13,6 +13,7 @@ import (
"github.com/owncloud/ocis/accounts/pkg/server/http"
svc "github.com/owncloud/ocis/accounts/pkg/service/v0"
"github.com/owncloud/ocis/accounts/pkg/tracing"
"github.com/owncloud/ocis/ocis-pkg/version"
"github.com/urfave/cli/v2"
)
@@ -41,7 +42,7 @@ func Server(cfg *config.Config) *cli.Command {
defer cancel()
mtrcs.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1)
mtrcs.BuildInfo.WithLabelValues(version.String).Set(1)
handler, err := svc.New(svc.Logger(logger), svc.Config(cfg))
if err != nil {
+1 -2
View File
@@ -2,6 +2,5 @@ package config
// Service defines the available service configuration.
type Service struct {
Name string
Version string
Name string
}
+2 -1
View File
@@ -3,6 +3,7 @@ package grpc
import (
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
"github.com/owncloud/ocis/ocis-pkg/version"
)
// Server initializes a new go-micro service ready to run
@@ -17,7 +18,7 @@ func Server(opts ...Option) grpc.Service {
grpc.Namespace(options.Config.GRPC.Namespace),
grpc.Logger(options.Logger),
grpc.Flags(options.Flags...),
grpc.Version(options.Config.Service.Version),
grpc.Version(version.String),
)
if err := proto.RegisterAccountsServiceHandler(service.Server(), handler); err != nil {
+1 -1
View File
@@ -21,7 +21,7 @@ func Server(opts ...Option) http.Service {
service := http.NewService(
http.Logger(options.Logger),
http.Name(options.Name),
http.Version(options.Config.Service.Version),
http.Version(version.String),
http.Address(options.Config.HTTP.Addr),
http.Namespace(options.Config.HTTP.Namespace),
http.Context(options.Context),