forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.go
36 lines (31 loc) · 988 Bytes
/
version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package version
import (
"github.com/golang/protobuf/ptypes/empty"
"golang.org/x/net/context"
argocd "github.com/argoproj/argo-cd"
ksutil "github.com/argoproj/argo-cd/util/ksonnet"
)
type Server struct{}
// Version returns the version of the API server
func (s *Server) Version(context.Context, *empty.Empty) (*VersionMessage, error) {
vers := argocd.GetVersion()
ksonnetVersion, err := ksutil.KsonnetVersion()
if err != nil {
return nil, err
}
return &VersionMessage{
Version: vers.Version,
BuildDate: vers.BuildDate,
GitCommit: vers.GitCommit,
GitTag: vers.GitTag,
GitTreeState: vers.GitTreeState,
GoVersion: vers.GoVersion,
Compiler: vers.Compiler,
Platform: vers.Platform,
KsonnetVersion: ksonnetVersion,
}, nil
}
// AuthFuncOverride allows the version to be returned without auth
func (s *Server) AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error) {
return ctx, nil
}