Merge pull request #202 from openziti/add.version.header.to.hello

Add.version.header.to.hello
This commit is contained in:
Andrew
2020-10-07 10:54:36 -04:00
committed by GitHub
9 changed files with 58 additions and 43 deletions
+2
View File
@@ -15,6 +15,8 @@
* Fix processing of `--configTypes all` in `ziti edge list services`
* Addressable Terminators and the eXtensible Terminator Validation framework
* GO Edge SDK now respects Service.EncryptionRequired setting
* [fabric#133 Add Version Information To Hellos](https://github.com/openziti/fabric/issues/133)
* [edge#326 Nested Transaction Deadlock](https://github.com/openziti/edge/issues/326)
# Config File Changes
The following should be added to controller configuration files when using the Edge components:
+19 -5
View File
@@ -17,25 +17,39 @@
package version
import (
"github.com/openziti/edge/build"
"github.com/openziti/foundation/common"
"runtime"
)
type cmdBuildInfo struct{}
func (c cmdBuildInfo) GetVersion() string {
func (c cmdBuildInfo) EncoderDecoder() common.VersionEncDec {
return &common.StdVersionEncDec
}
func (c cmdBuildInfo) Version() string {
return Version
}
func (c cmdBuildInfo) GetRevision() string {
func (c cmdBuildInfo) Revision() string {
return Revision
}
func (c cmdBuildInfo) GetBuildDate() string {
func (c cmdBuildInfo) BuildDate() string {
return BuildDate
}
func GetCmdBuildInfo() build.Info {
func (c cmdBuildInfo) AsVersionInfo() *common.VersionInfo {
return &common.VersionInfo{
Version: c.Version(),
Revision: c.Revision(),
BuildDate: c.BuildDate(),
OS: GetOS(),
Arch: GetArchitecture(),
}
}
func GetCmdBuildInfo() common.VersionProvider {
return cmdBuildInfo{}
}
+3 -3
View File
@@ -3,9 +3,9 @@
package version
const (
Version = "v0.16.2-beta07"
Version = "v0.0.0"
Revision = "local"
Branch = "local"
BuildUser = "Andrew Martinez"
BuildDate = "2020-08-24 09:00:00"
BuildUser = "local"
BuildDate = "2020-01-01 01:01:01"
)
+8 -8
View File
@@ -2,15 +2,15 @@ module github.com/openziti/ziti
go 1.14
// replace github.com/openziti/foundation => ../foundation
//replace github.com/openziti/foundation => ../foundation
// replace github.com/michaelquigley/dilithium => ../../q/research/dilithium
// replace github.com/openziti/fabric => ../fabric
//replace github.com/openziti/fabric => ../fabric
// replace github.com/openziti/sdk-golang => ../sdk-golang
//replace github.com/openziti/sdk-golang => ../sdk-golang
// replace github.com/openziti/edge => ../edge
//replace github.com/openziti/edge => ../edge
require (
github.com/Jeffail/gabs v1.4.0
@@ -26,10 +26,10 @@ require (
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19
github.com/michaelquigley/pfxlog v0.0.0-20190813191113-2be43bd0dccc
github.com/openziti/edge v0.16.25
github.com/openziti/fabric v0.14.3
github.com/openziti/foundation v0.14.6
github.com/openziti/sdk-golang v0.13.48
github.com/openziti/edge v0.16.35
github.com/openziti/fabric v0.14.6
github.com/openziti/foundation v0.14.7
github.com/openziti/sdk-golang v0.13.49
github.com/pborman/uuid v1.2.0
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
+16 -20
View File
@@ -81,6 +81,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
@@ -143,8 +145,8 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g
github.com/go-openapi/runtime v0.19.15 h1:2GIefxs9Rx1vCDNghRtypRq+ig8KSLrjHbAYI/gCLCM=
github.com/go-openapi/runtime v0.19.15/go.mod h1:dhGWCTKRXlAfGnQG0ONViOZpjfg0m2gUt9nTQPQZuoo=
github.com/go-openapi/runtime v0.19.16/go.mod h1:5P9104EJgYcizotuXhEuUrzVc+j1RiSjahULvYmlv98=
github.com/go-openapi/runtime v0.19.21 h1:81PiYus9l6fwwS4EwhJD+tQb3EPZBeWfgdAVTfFD25Q=
github.com/go-openapi/runtime v0.19.21/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk=
github.com/go-openapi/runtime v0.19.22 h1:vtT7gJwxIK96BVTd9Ce5OPNQfIsk+q1j/+0e98NoVXk=
github.com/go-openapi/runtime v0.19.22/go.mod h1:Lm9YGCeecBnUUkFTxPC4s1+lwrkJ0pthx8YvyjCfkgk=
github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY=
@@ -254,8 +256,8 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
@@ -309,8 +311,6 @@ github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -418,20 +418,18 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
github.com/openziti/edge v0.16.25 h1:sbMNAG3nuxozahljCnIJMuOeDBaDadsbG6Snrk8ZbVk=
github.com/openziti/edge v0.16.25/go.mod h1:XmW5s/L+T/EMpLAn1CcUhFsjhlZuRIXR+Kh4IhBukII=
github.com/openziti/fabric v0.14.2 h1:G+/iquSwMJBEtDDJQhYhdRysvnl/u82X+/Kqk3hC0sE=
github.com/openziti/fabric v0.14.2/go.mod h1:xlES2jGDEuvDGMXvAugWVDhbZdx8dTw6jZBeX1s52Wc=
github.com/openziti/fabric v0.14.3 h1:IoTfizWZ8N0UqFbqRS3b1sRWrQ+6x+LUayxwwxbfmsM=
github.com/openziti/fabric v0.14.3/go.mod h1:/B6CHpmqrzyCBixpYdpryjEHfHvd39B4SsEeHIn01Ok=
github.com/openziti/foundation v0.14.5 h1:GifwpaJz1jqkHN65spQQATnLVr2B/JYrBSaGCxenMZM=
github.com/openziti/foundation v0.14.5/go.mod h1:BxcI+GProVBiFYRDkrjg+/r5ptd8/iYdsc+bxAxwQCk=
github.com/openziti/edge v0.16.35 h1:6z8lPKXDyaKUqisET43tON3V7zlUSNyAcGskyBSIq8g=
github.com/openziti/edge v0.16.35/go.mod h1:vQfcEEjeO4u4/8tcN+jt4Mu9+JHdYVK81t/d0xVEuCU=
github.com/openziti/fabric v0.14.5 h1:ALuOv7eeYl1Lq+fgTvxTsww4DaNo+irAHNCJZbqicPU=
github.com/openziti/fabric v0.14.5/go.mod h1:ZBLxFQHPGe2QOBKaC1Gy/7J2IXViLmdkNt1QhIi3DKo=
github.com/openziti/fabric v0.14.6 h1:LzGq7wXw6w/l1qVIhViRqkmDdprmkreyAD8d0b8rqmI=
github.com/openziti/fabric v0.14.6/go.mod h1:ZBLxFQHPGe2QOBKaC1Gy/7J2IXViLmdkNt1QhIi3DKo=
github.com/openziti/foundation v0.14.6 h1:js65hn84mQxxDZbAjAzS7qJrEKVBpf5UKGWMzsUY1Ys=
github.com/openziti/foundation v0.14.6/go.mod h1:b8Ox/vvvdObz1JoEno0z7KN1cx0echQ7eP/tOmjbB+4=
github.com/openziti/sdk-golang v0.13.47 h1:VsrOv9nTQWGdS89hKG8LSQvWzJFWZtNtBT+o4ULYP70=
github.com/openziti/sdk-golang v0.13.47/go.mod h1:Xxz3Gxnms/NvdTQR8ltoui4AHSXX8JqABOkO5OdL/74=
github.com/openziti/sdk-golang v0.13.48 h1:1t220DgGZYfxBQRytfnrdoBhUVGLzogWGI75UKfAAZA=
github.com/openziti/sdk-golang v0.13.48/go.mod h1:9EFqAuUgRoURRgCB/Abap69XXM58js1HizPK/yTxQuQ=
github.com/openziti/foundation v0.14.7 h1:TAFR1M7udfGQvUtWrflsGis9gGev29vKuUnIvh0yEoM=
github.com/openziti/foundation v0.14.7/go.mod h1:b8Ox/vvvdObz1JoEno0z7KN1cx0echQ7eP/tOmjbB+4=
github.com/openziti/sdk-golang v0.13.49 h1:UVzaJSiEM4yid+78bnOkGsyJffyZlCI2YXpMfgOAwKo=
github.com/openziti/sdk-golang v0.13.49/go.mod h1:9EFqAuUgRoURRgCB/Abap69XXM58js1HizPK/yTxQuQ=
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw=
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
@@ -507,8 +505,6 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+3 -2
View File
@@ -17,9 +17,10 @@
package subcmd
import (
edgeSubCmd "github.com/openziti/edge/controller/subcmd"
"fmt"
"github.com/michaelquigley/pfxlog"
edgeSubCmd "github.com/openziti/edge/controller/subcmd"
"github.com/openziti/ziti/common/version"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@@ -29,7 +30,7 @@ func init() {
root.PersistentFlags().BoolVarP(&cliAgentEnabled, "cliagent", "a", false, "Enable CLI Agent (use in dev only)")
root.PersistentFlags().StringVar(&logFormatter, "log-formatter", "", "Specify log formatter [json|pfxlog|text]")
edgeSubCmd.AddCommands(root)
edgeSubCmd.AddCommands(root, version.GetCmdBuildInfo())
}
var root = &cobra.Command{
+2 -1
View File
@@ -18,6 +18,7 @@ package subcmd
import (
"fmt"
"github.com/openziti/ziti/common/version"
"github.com/openziti/ziti/ziti/agent"
"github.com/openziti/edge/controller/server"
"github.com/openziti/fabric/controller"
@@ -44,7 +45,7 @@ func run(cmd *cobra.Command, args []string) {
}
var c *controller.Controller
if c, err = controller.NewController(config); err != nil {
if c, err = controller.NewController(config, version.GetCmdBuildInfo()); err != nil {
fmt.Printf("unable to create fabric controller %+v\n", err)
panic(err)
}
+2 -2
View File
@@ -59,7 +59,7 @@ var listRouters = &cobra.Command{
err := proto.Unmarshal(responseMsg.Body, response)
if err == nil {
out := fmt.Sprintf("\nRouters: (%d)\n\n", len(response.Routers))
out += fmt.Sprintf("%-12s | %-30s | %-40s | %s\n", "Id", "Name", "Fingerprint", "Status")
out += fmt.Sprintf("%-12s | %-30s | %-40s | %-9s | %s\n", "Id", "Name", "Fingerprint", "Status", "Version")
for _, r := range response.Routers {
status := ""
if r.Connected {
@@ -68,7 +68,7 @@ var listRouters = &cobra.Command{
if r.ListenerAddress != "" {
status += " (" + r.ListenerAddress + ")"
}
out += fmt.Sprintf("%-12s | %-30s | %-40s | %s\n", r.Id, r.Name, r.Fingerprint, status)
out += fmt.Sprintf("%-12s | %-30s | %-40s | %-9s | %s\n", r.Id, r.Name, r.Fingerprint, status, r.Version)
}
out += "\n"
fmt.Print(out)
+3 -2
View File
@@ -21,6 +21,7 @@ import (
"github.com/openziti/edge/gateway/xgress_edge_transport"
"github.com/openziti/fabric/router"
"github.com/openziti/fabric/router/xgress"
"github.com/openziti/ziti/common/version"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
@@ -41,9 +42,9 @@ func run(cmd *cobra.Command, args []string) {
if config, err := router.LoadConfig(args[0]); err == nil {
config.SetFlags(getFlags(cmd))
r := router.Create(config)
r := router.Create(config, version.GetCmdBuildInfo())
xgressEdgeFactory := xgress_edge.NewFactory()
xgressEdgeFactory := xgress_edge.NewFactory(version.GetCmdBuildInfo())
xgress.GlobalRegistry().Register("edge", xgressEdgeFactory)
if err := r.RegisterXctrl(xgressEdgeFactory); err != nil {
logrus.Panicf("error registering edge in framework (%v)", err)