Skip to content

Commit

Permalink
Bumped v0.5.9
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <vr@labstack.com>
  • Loading branch information
vishr committed Nov 15, 2019
1 parent 93600fc commit f9351d2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IMAGE = labstack/tunnel
VERSION = 0.5.8
VERSION = 0.5.9

publish:
git tag v$(VERSION)
Expand Down
10 changes: 5 additions & 5 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/spf13/viper"
)

var name string
var configuration string
var protocol string
var rootCmd = &cobra.Command{
Use: "tunnel [address]",
Expand All @@ -41,9 +41,9 @@ var rootCmd = &cobra.Command{
addr = ":" + addr
}
err = c.Call("Server.Connect", &daemon.ConnectRequest{
Name: name,
Address: addr,
Protocol: daemon.Protocol(protocol),
Configuration: configuration,
Address: addr,
Protocol: daemon.Protocol(protocol),
}, rep)
if err != nil {
exit(err)
Expand Down Expand Up @@ -98,7 +98,7 @@ func initialize() {
}

func init() {
rootCmd.PersistentFlags().StringVarP(&name, "name", "n", "",
rootCmd.PersistentFlags().StringVarP(&configuration, "configuration", "c", "",
"configuration name from the console")
rootCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", daemon.ProtocolHTTPS,
"connection protocol (https, tcp, tls)")
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
version = "v0.4.2"
version = "v0.5.9"
)

var versionCmd = &cobra.Command{
Expand Down
6 changes: 3 additions & 3 deletions daemon/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,17 @@ func (s *Server) newConnection(req *ConnectRequest) (c *Connection, err error) {
},
}
e := new(Error)
if req.Name != "" {
if req.Configuration != "" {
res, err := s.resty.R().
SetResult(c.Configuration).
SetError(e).
Get("/configurations/" + req.Name)
Get("/configurations/" + req.Configuration)
if err != nil {
return nil, fmt.Errorf("failed to the find the configuration: %v", err)
} else if res.IsError() {
return nil, fmt.Errorf("failed to the find the configuration: %s", e.Message)
}
c.Name = req.Name
c.Name = req.Configuration
} else {
if req.Protocol == ProtocolTLS {
c.Header.TLS = true
Expand Down
6 changes: 3 additions & 3 deletions daemon/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type (
Protocol string

ConnectRequest struct {
Name string
Address string
Protocol Protocol
Configuration string
Address string
Protocol Protocol
}

ConnectReply struct {
Expand Down

0 comments on commit f9351d2

Please sign in to comment.