From ea3f76b78378350564b58e46c9da44cf67a269ec Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Fri, 24 May 2019 21:41:53 -0700 Subject: 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 --- src/k8splugin/plugins/ovn4nfvk8s-network/plugin.go | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/k8splugin/plugins/ovn4nfvk8s-network') 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 } -- cgit 1.2.3-korg