summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-06 11:22:46 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-06 11:22:49 -0700
commit381e61199653bbfa7da9c5349acad87a944fc8b8 (patch)
tree1cddb1fbafa658340eee1e826a8d8d4a525fca1b /src
parenta2ae972e814f80184033ee75e9715d1d76323410 (diff)
Make service port configurable0.1.0
Service port should be configurable. This patch removes the hardcoded value. The default value is 9015 Issue-ID: MULTICLOUD-609 Change-Id: Iae05f42bd06ecd061ec68a3a7c4a4a87f33b22fa Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/k8splugin/cmd/main.go3
-rw-r--r--src/k8splugin/internal/config/config.go2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/k8splugin/cmd/main.go b/src/k8splugin/cmd/main.go
index 607e3fe1..d6d9d75a 100644
--- a/src/k8splugin/cmd/main.go
+++ b/src/k8splugin/cmd/main.go
@@ -25,6 +25,7 @@ import (
"k8splugin/api"
utils "k8splugin/internal"
"k8splugin/internal/auth"
+ "k8splugin/internal/config"
"github.com/gorilla/handlers"
)
@@ -44,7 +45,7 @@ func main() {
httpServer := &http.Server{
Handler: loggedRouter,
- Addr: ":8081", // Remove hardcoded port number
+ Addr: ":" + config.GetConfiguration().ServicePort,
}
connectionsClose := make(chan struct{})
diff --git a/src/k8splugin/internal/config/config.go b/src/k8splugin/internal/config/config.go
index c3ca9054..dc3f7a11 100644
--- a/src/k8splugin/internal/config/config.go
+++ b/src/k8splugin/internal/config/config.go
@@ -39,6 +39,7 @@ type Configuration struct {
EtcdCAFile string `json:"etcd-ca-file"`
KubeConfigDir string `json:"kube-config-dir"`
OVNCentralAddress string `json:"ovn-central-address"`
+ ServicePort string `json:"service-port"`
}
// Config is the structure that stores the configuration
@@ -87,6 +88,7 @@ func defaultConfiguration() *Configuration {
EtcdCAFile: "etcd-ca.cert",
KubeConfigDir: cwd,
OVNCentralAddress: "127.0.0.1",
+ ServicePort: "9015",
}
}