remove version from service config

This commit is contained in:
Willy Kloucek
2022-01-03 16:24:39 +01:00
committed by Jörn Friedrich Dreyer
parent b9f2b6b91e
commit adc7b3b3d2
40 changed files with 70 additions and 58 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package command
import (
"context"
"github.com/owncloud/ocis/ocis-pkg/version"
"github.com/owncloud/ocis/ocs/pkg/config/parser"
"github.com/owncloud/ocis/ocs/pkg/logging"
"github.com/owncloud/ocis/ocs/pkg/tracing"
@@ -47,7 +48,7 @@ func Server(cfg *config.Config) *cli.Command {
defer cancel()
metrics.BuildInfo.WithLabelValues(cfg.Service.Version).Set(1)
metrics.BuildInfo.WithLabelValues(version.String).Set(1)
{
server, err := http.Server(
+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
@@ -5,6 +5,7 @@ import (
"net/http"
"github.com/owncloud/ocis/ocis-pkg/service/debug"
"github.com/owncloud/ocis/ocis-pkg/version"
"github.com/owncloud/ocis/ocs/pkg/config"
)
@@ -15,7 +16,7 @@ func Server(opts ...Option) (*http.Server, error) {
return debug.NewService(
debug.Logger(options.Logger),
debug.Name(options.Config.Service.Name),
debug.Version(options.Config.Service.Version),
debug.Version(version.String),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
+6 -2
View File
@@ -5,6 +5,7 @@ import (
"github.com/owncloud/ocis/ocis-pkg/cors"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
"github.com/owncloud/ocis/ocis-pkg/version"
ocsmw "github.com/owncloud/ocis/ocs/pkg/middleware"
svc "github.com/owncloud/ocis/ocs/pkg/service/v0"
"go-micro.dev/v4"
@@ -17,7 +18,7 @@ func Server(opts ...Option) (http.Service, error) {
service := http.NewService(
http.Logger(options.Logger),
http.Name(options.Config.Service.Name),
http.Version(options.Config.Service.Version),
http.Version(version.String),
http.Namespace(options.Config.HTTP.Namespace),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
@@ -39,7 +40,10 @@ func Server(opts ...Option) (http.Service, error) {
cors.AllowCredentials(options.Config.HTTP.CORS.AllowCredentials),
),
middleware.Secure,
middleware.Version(options.Config.Service.Name, options.Config.Service.Version),
middleware.Version(
options.Config.Service.Name,
version.String,
),
middleware.Logger(options.Logger),
ocsmw.LogTrace,
),