Discard package "version" (#2107)

* Discard package "version"

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Inject api version

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

* Pass version arg to the dex API

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
Maksim Nabokikh
2021-05-18 01:55:24 +03:00
committed by GitHub
parent 47d029a51b
commit 20875c972e
6 changed files with 14 additions and 18 deletions

View File

@@ -449,7 +449,7 @@ func runServe(options serveOptions) error {
}
grpcSrv := grpc.NewServer(grpcOptions...)
api.RegisterDexServer(grpcSrv, server.NewAPI(serverConfig.Storage, logger))
api.RegisterDexServer(grpcSrv, server.NewAPI(serverConfig.Storage, logger, version))
grpcMetrics.InitializeMetrics(grpcSrv)
if c.GRPC.Reflection {

View File

@@ -5,10 +5,10 @@ import (
"runtime"
"github.com/spf13/cobra"
"github.com/dexidp/dex/version"
)
var version = "DEV"
func commandVersion() *cobra.Command {
return &cobra.Command{
Use: "version",
@@ -16,7 +16,7 @@ func commandVersion() *cobra.Command {
Run: func(_ *cobra.Command, _ []string) {
fmt.Printf(
"Dex Version: %s\nGo Version: %s\nGo OS/ARCH: %s %s\n",
version.Version,
version,
runtime.Version(),
runtime.GOOS,
runtime.GOARCH,