Inform Dryad about SSH listen address 14/180914/4
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Mon, 28 May 2018 14:51:57 +0000 (16:51 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 1 Aug 2018 16:05:38 +0000 (18:05 +0200)
When multiple Dryads run under the same IP address, SSH and Dryad listen
ports must be different.

Change-Id: Iedf8dd5aafb0c45c6d8c6c6b45bc61d47c720041
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
dryad/conf/conf.go
dryad/conf/conf_test.go

index 049fb7b..d8b37cd 100644 (file)
@@ -31,11 +31,15 @@ import (
 // for Dryad's RPC client and server.
 const DefaultRPCPort = 7175
 
+// DefaultSSHPort is a default port off SSH daemon.
+const DefaultSSHPort = 22
+
 // NewConf returns a new instance of General configuration with default values set.
 func NewConf() *General {
        return &General{
-               Address: fmt.Sprintf(":%d", DefaultRPCPort),
-               Caps:    Capabilities(map[string]string{}),
+               Address:   fmt.Sprintf(":%d", DefaultRPCPort),
+               SSHAdress: fmt.Sprintf(":%d", DefaultSSHPort),
+               Caps:      Capabilities(map[string]string{}),
                User: &User{
                        Name:   "boruta-user",
                        Groups: []string{},
@@ -60,6 +64,8 @@ type General struct {
        Address string `toml:"listen_address"`
        // BorutaAddress is used to connect to Boruta server.
        BorutaAddress string `toml:"boruta_address"`
+       // SSHAdress is a ssh daemon listen address.
+       SSHAdress string `toml:"ssh_address"`
        // Caps are necessary information to register in Boruta.
        //
        // TODO(amistewicz): This field should be removed when
index f8f9997..c220a5f 100644 (file)
@@ -30,6 +30,7 @@ import (
 var _ = Describe("Conf", func() {
        marshaled := `listen_address = ":7175"
 boruta_address = ""
+ssh_address = ":22"
 sdcard = "/dev/sdX"
 stm_path = "/run/stm.socket"
 
@@ -40,8 +41,9 @@ stm_path = "/run/stm.socket"
   groups = []
 `
        unmarshaled := &General{
-               Address: ":7175",
-               Caps:    boruta.Capabilities(map[string]string{}),
+               Address:   ":7175",
+               SSHAdress: ":22",
+               Caps:      boruta.Capabilities(map[string]string{}),
                User: &User{
                        Name:   "boruta-user",
                        Groups: []string{},