Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix version info #3953

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions changelog/unreleased/fix-version-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Bugfix: Fix version info

We've fixed the version info that is displayed when you run:

- `ocis version`
- `ocis <extension name> version`

Since #2918, these commands returned an empty version only.

https://github.com/owncloud/ocis/pull/3953
2 changes: 1 addition & 1 deletion extensions/app-provider/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/app-provider/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/app-provider/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/app-registry/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/app-registry/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/app-registry/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-basic/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-basic/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-basic/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-bearer/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-bearer/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-bearer/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-machine/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-machine/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/auth-machine/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/frontend/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.HTTP.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.HTTP.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the http endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/frontend/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/frontend/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/gateway/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/gateway/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/gateway/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/graph-explorer/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Server(cfg *config.Config) *cli.Command {

defer cancel()

mtrcs.BuildInfo.WithLabelValues(version.String).Set(1)
mtrcs.BuildInfo.WithLabelValues(version.GetString()).Set(1)

{
server, err := http.Server(
Expand Down
2 changes: 1 addition & 1 deletion extensions/graph-explorer/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/graph-explorer/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
4 changes: 2 additions & 2 deletions extensions/graph-explorer/pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func Server(opts ...Option) (http.Service, error) {
http.Logger(options.Logger),
http.Namespace(options.Namespace),
http.Name("graph-explorer"),
http.Version(version.String),
http.Version(version.GetString()),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
Expand All @@ -33,7 +33,7 @@ func Server(opts ...Option) (http.Service, error) {
middleware.Secure,
middleware.Version(
"graph-explorer",
version.String,
version.GetString(),
),
middleware.Logger(
options.Logger,
Expand Down
2 changes: 1 addition & 1 deletion extensions/graph/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Server(cfg *config.Config) *cli.Command {

defer cancel()

mtrcs.BuildInfo.WithLabelValues(version.String).Set(1)
mtrcs.BuildInfo.WithLabelValues(version.GetString()).Set(1)

{
server, err := http.Server(
Expand Down
2 changes: 1 addition & 1 deletion extensions/graph/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/graph/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
4 changes: 2 additions & 2 deletions extensions/graph/pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func Server(opts ...Option) (http.Service, error) {
http.Logger(options.Logger),
http.Namespace(options.Config.HTTP.Namespace),
http.Name("graph"),
http.Version(version.String),
http.Version(version.GetString()),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
Expand All @@ -46,7 +46,7 @@ func Server(opts ...Option) (http.Service, error) {
chimiddleware.RequestID,
middleware.Version(
"graph",
version.String,
version.GetString(),
),
middleware.Logger(
options.Logger,
Expand Down
2 changes: 1 addition & 1 deletion extensions/groups/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func Server(cfg *config.Config) *cli.Command {
cfg.GRPC.Namespace+"."+cfg.Service.Name,
uuid.Must(uuid.NewV4()).String(),
cfg.GRPC.Addr,
version.String,
version.GetString(),
logger,
); err != nil {
logger.Fatal().Err(err).Msg("failed to register the grpc endpoint")
Expand Down
2 changes: 1 addition & 1 deletion extensions/groups/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/groups/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/idm/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
2 changes: 1 addition & 1 deletion extensions/idp/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func Server(cfg *config.Config) *cli.Command {

defer cancel()

metrics.BuildInfo.WithLabelValues(version.String).Set(1)
metrics.BuildInfo.WithLabelValues(version.GetString()).Set(1)

{
server, err := http.Server(
Expand Down
2 changes: 1 addition & 1 deletion extensions/idp/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/idp/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Server(opts ...Option) (*http.Server, error) {
return debug.NewService(
debug.Logger(options.Logger),
debug.Name(options.Config.Service.Name),
debug.Version(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
4 changes: 2 additions & 2 deletions extensions/idp/pkg/server/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func Server(opts ...Option) (http.Service, error) {
http.Logger(options.Logger),
http.Namespace(options.Config.HTTP.Namespace),
http.Name(options.Config.Service.Name),
http.Version(version.String),
http.Version(version.GetString()),
http.Address(options.Config.HTTP.Addr),
http.Context(options.Context),
http.Flags(options.Flags...),
Expand All @@ -61,7 +61,7 @@ func Server(opts ...Option) (http.Service, error) {
middleware.Secure,
middleware.Version(
options.Config.Service.Name,
version.String,
version.GetString(),
),
middleware.Logger(
options.Logger,
Expand Down
2 changes: 1 addition & 1 deletion extensions/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Server(cfg *config.Config) *cli.Command {
gr.Add(func() error {
s, err := ocdav.Service(
ocdav.Name(cfg.HTTP.Namespace+"."+cfg.Service.Name),
ocdav.Version(version.String),
ocdav.Version(version.GetString()),
ocdav.Context(ctx),
ocdav.Logger(logger.Logger),
ocdav.Address(cfg.HTTP.Addr),
Expand Down
2 changes: 1 addition & 1 deletion extensions/ocdav/pkg/command/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Version(cfg *config.Config) *cli.Command {
Usage: "print the version of this binary and the running extension instances",
Category: "info",
Action: func(c *cli.Context) error {
fmt.Println("Version: " + version.String)
fmt.Println("Version: " + version.GetString())
fmt.Printf("Compiled: %s\n", version.Compiled())
fmt.Println("")

Expand Down
2 changes: 1 addition & 1 deletion extensions/ocdav/pkg/server/debug/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,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(version.String),
debug.Version(version.GetString()),
debug.Address(options.Config.Debug.Addr),
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
Expand Down
Loading