aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/plugins
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-24 21:41:53 -0700
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-05-24 21:41:59 -0700
commitea3f76b78378350564b58e46c9da44cf67a269ec (patch)
tree9316b58791abecd40d2cbdf5acc2aa22073997ac /src/k8splugin/plugins
parent574eb961e8651ba4e4f0f92d7984a2716e5e64f7 (diff)
Remove env variable
Remove ENV variable. Somehow I missed removing this variable when we moved to configuration files. Issue-ID: MULTICLOUD-653 Change-Id: Ibf2238791dfcb1e66c7b9cca7b6d25e3d30bb0e4 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/plugins')
-rw-r--r--src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go b/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go
index 3f5d80ba..d8f354fb 100644
--- a/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go
+++ b/src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go
@@ -16,17 +16,17 @@ package main
import (
"bytes"
"fmt"
- kexec "k8s.io/utils/exec"
- "os"
-
- pkgerrors "github.com/pkg/errors"
- "k8splugin/plugins/network/v1"
"log"
+ "math/rand"
"strings"
+ "time"
"unicode"
- "math/rand"
- "time"
+ "k8splugin/internal/config"
+ v1 "k8splugin/plugins/network/v1"
+
+ pkgerrors "github.com/pkg/errors"
+ kexec "k8s.io/utils/exec"
)
const (
@@ -77,20 +77,20 @@ func init() {
// CreateNetwork in OVN controller
func CreateNetwork(network *v1.OnapNetwork) (string, error) {
- name := network.Spec.Name
- if name == "" {
- return "", pkgerrors.New("Invalid Network Name")
- }
+ name := network.Spec.Name
+ if name == "" {
+ return "", pkgerrors.New("Invalid Network Name")
+ }
- subnet := network.Spec.Subnet
- if subnet == "" {
- return "", pkgerrors.New("Invalid Subnet Address")
- }
+ subnet := network.Spec.Subnet
+ if subnet == "" {
+ return "", pkgerrors.New("Invalid Subnet Address")
+ }
- gatewayIPMask := network.Spec.Gateway
- if gatewayIPMask == "" {
- return "", pkgerrors.New("Invalid Gateway Address")
- }
+ gatewayIPMask := network.Spec.Gateway
+ if gatewayIPMask == "" {
+ return "", pkgerrors.New("Invalid Gateway Address")
+ }
routerMac, stderr, err := ovnCmd.Run(getAuthStr(), "--if-exist", "-v", "get", "logical_router_port", "rtos-"+name, "mac")
if err != nil {
@@ -148,6 +148,6 @@ func DeleteNetwork(name string) error {
func getAuthStr() string {
//TODO: Remove hardcoding: Use ESR data passed to Initialize
- ovnCentralAddress := os.Getenv("OVN_CENTRAL_ADDRESS")
+ ovnCentralAddress := config.GetConfiguration().OVNCentralAddress
return "--db=tcp:" + ovnCentralAddress
}