kube-router/pkg/version/version.go
Manuel Rüger 7d47aefe7d Replace github.com/golang/glog with k8s.io/klog/v2
glog is effectively unmaintained and the kubernetes ecosystem is mainly
using its fork klog

Fixes: #1051
2021-04-11 13:16:03 -05:00

24 lines
423 B
Go

package version
import (
"fmt"
"os"
"runtime"
"k8s.io/klog/v2"
)
// Version and BuildDate are injected at build time via ldflags
var Version string
var BuildDate string
func PrintVersion(logOutput bool) {
output := fmt.Sprintf("Running %v version %s, built on %s, %s\n", os.Args[0], Version, BuildDate, runtime.Version())
if !logOutput {
fmt.Fprintf(os.Stderr, "%s", output)
} else {
klog.Info(output)
}
}