Add version info into the apps (#330)

Both worker and coordinator display version number in the console during startup. Coordinator displays its version number in the top right corner of the index.html page.
This commit is contained in:
sergystepanov 2021-07-16 18:13:20 +03:00 committed by GitHub
parent cbabe69f30
commit 30d104ee98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 59 additions and 5 deletions

View file

@ -16,6 +16,8 @@ import (
flag "github.com/spf13/pflag"
)
var Version = ""
func main() {
rand.Seed(time.Now().UTC().UnixNano())
@ -28,6 +30,7 @@ func main() {
ctx, cancelCtx := context.WithCancel(context.Background())
glog.Infof("[coordinator] version: %v", Version)
glog.Infof("Initializing coordinator server")
glog.V(4).Infof("Coordinator configs %v", conf)
o := coordinator.New(ctx, conf)

View file

@ -17,6 +17,8 @@ import (
flag "github.com/spf13/pflag"
)
var Version = ""
func init() {
rand.Seed(time.Now().UTC().UnixNano())
}
@ -31,6 +33,7 @@ func run() {
ctx, cancelCtx := context.WithCancel(context.Background())
glog.Infof("[worker] version: %v", Version)
glog.V(4).Info("[worker] Initialization")
glog.V(4).Infof("[worker] Local configuration %+v", conf)
wrk := worker.New(ctx, conf)