diff --git a/GoMain/src/main/main.go b/GoMain/src/main/main.go index 011ae912..fa75aa47 100644 --- a/GoMain/src/main/main.go +++ b/GoMain/src/main/main.go @@ -21,15 +21,15 @@ package main import ( "errors" "log" - "strings" "os" + "strings" "common/logmgr" "common/sigmgr" configuremgr "controller/configuremgr/container" "controller/discoverymgr" - "controller/mnedcmgr" + mnedcmgr "controller/discoverymgr/mnedc" "controller/scoringmgr" "controller/securemgr/authenticator" "controller/securemgr/authorizer" @@ -72,10 +72,10 @@ const ( passPhraseJWTPath = edgeDir + "/data/jwt" rbacRulePath = edgeDir + "/data/rbac" - cipherKeyFilePath = edgeDir + "/user/orchestration_userID.txt" - deviceIDFilePath = edgeDir + "/device/orchestration_deviceID.txt" - dataStorageFilePath = edgeDir + "/datastorage/configuration.toml" - mnedcServerConfig = edgeDir + "/mnedc/client.config" + cipherKeyFilePath = edgeDir + "/user/orchestration_userID.txt" + deviceIDFilePath = edgeDir + "/device/orchestration_deviceID.txt" + dataStorageFilePath = edgeDir + "/datastorage/configuration.toml" + mnedcServerConfig = edgeDir + "/mnedc/client.config" ) var ( @@ -104,8 +104,8 @@ func orchestrationInit() error { mnedc := os.Getenv("MNEDC") isSecured := false - if len(secure)>0 { - if strings.Compare(strings.ToLower(secure), "true")==0 { + if len(secure) > 0 { + if strings.Compare(strings.ToLower(secure), "true") == 0 { log.Println("Orchestration init with secure option") isSecured = true } @@ -130,6 +130,7 @@ func orchestrationInit() error { servicemgr.GetInstance().SetClient(restIns) discoverymgr.GetInstance().SetClient(restIns) + mnedcmgr.GetClientInstance().SetClient(restIns) builder := orchestrationapi.OrchestrationBuilder{} builder.SetWatcher(configuremgr.GetInstance(configPath)) @@ -182,7 +183,7 @@ func orchestrationInit() error { restEdgeRouter.Start() - if _, err := os.Stat(dataStorageFilePath); err==nil { + if _, err := os.Stat(dataStorageFilePath); err == nil { sd := storagedriver.StorageDriver{} go startup.Bootstrap(dataStorageService, device.Version, &sd) } @@ -190,20 +191,20 @@ func orchestrationInit() error { log.Println(logPrefix, "orchestration init done") if len(mnedc) > 0 { - if strings.Compare(strings.ToLower(mnedc), "server") == 0 { - if isSecured { - mnedcmgr.GetServerInstance().SetCipher(dummy.GetCipher(cipherKeyFilePath)) - mnedcmgr.GetServerInstance().SetCertificateFilePath(certificateFilePath) - } else { - mnedcmgr.GetServerInstance().SetCipher(sha256.GetCipher(cipherKeyFilePath)) - } - go mnedcmgr.GetServerInstance().StartMNEDCServer(deviceIDFilePath) - } else if strings.Compare(strings.ToLower(mnedc), "client") == 0 { - if isSecured { - mnedcmgr.GetClientInstance().SetCertificateFilePath(certificateFilePath) - } - go mnedcmgr.GetClientInstance().StartMNEDCClient(deviceIDFilePath, mnedcServerConfig) - } + if strings.Compare(strings.ToLower(mnedc), "server") == 0 { + if isSecured { + mnedcmgr.GetServerInstance().SetCipher(dummy.GetCipher(cipherKeyFilePath)) + mnedcmgr.GetServerInstance().SetCertificateFilePath(certificateFilePath) + } else { + mnedcmgr.GetServerInstance().SetCipher(sha256.GetCipher(cipherKeyFilePath)) + } + go discoverymgr.GetInstance().StartMNEDCServer(deviceIDFilePath) + } else if strings.Compare(strings.ToLower(mnedc), "client") == 0 { + if isSecured { + mnedcmgr.GetClientInstance().SetCertificateFilePath(certificateFilePath) + } + go discoverymgr.GetInstance().StartMNEDCClient(deviceIDFilePath, mnedcServerConfig) + } } else { if strings.Contains(buildTags, "mnedcserver") { if isSecured { @@ -212,12 +213,12 @@ func orchestrationInit() error { } else { mnedcmgr.GetServerInstance().SetCipher(sha256.GetCipher(cipherKeyFilePath)) } - go mnedcmgr.GetServerInstance().StartMNEDCServer(deviceIDFilePath) + go discoverymgr.GetInstance().StartMNEDCServer(deviceIDFilePath) } else if strings.Contains(buildTags, "mnedcclient") { if isSecured { mnedcmgr.GetClientInstance().SetCertificateFilePath(certificateFilePath) } - go mnedcmgr.GetClientInstance().StartMNEDCClient(deviceIDFilePath, mnedcServerConfig) + go discoverymgr.GetInstance().StartMNEDCClient(deviceIDFilePath, mnedcServerConfig) } } diff --git a/build.sh b/build.sh index 8499dd86..ac0ebe18 100755 --- a/build.sh +++ b/build.sh @@ -34,11 +34,11 @@ PKG_LIST=( "controller/servicemgr/executor/containerexecutor" "controller/servicemgr/executor/nativeexecutor" "controller/servicemgr/notification" - "controller/mnedcmgr" - "controller/mnedcmgr/client" - "controller/mnedcmgr/connectionutil" - "controller/mnedcmgr/server" - "controller/mnedcmgr/tunmgr" + "controller/discoverymgr/mnedc" + "controller/discoverymgr/mnedc/client" + "controller/discoverymgr/mnedc/connectionutil" + "controller/discoverymgr/mnedc/server" + "controller/discoverymgr/mnedc/tunmgr" "controller/storagemgr/storagedriver" "db/bolt/common" "db/bolt/configuration" diff --git a/glide.yaml b/glide.yaml index 872bf72f..672d11eb 100644 --- a/glide.yaml +++ b/glide.yaml @@ -33,11 +33,11 @@ ignore: - controller/servicemgr/executor/containerexecutor - controller/servicemgr/executor/nativeexecutor - controller/servicemgr/notification - - controller/mnedcmgr - - controller/mnedcmgr/client - - controller/mnedcmgr/connectionutil - - controller/mnedcmgr/server - - controller/mnedcmgr/tunmgr + - controller/discoverymgr/mnedc + - controller/discoverymgr/mnedc/client + - controller/discoverymgr/mnedc/connectionutil + - controller/discoverymgr/mnedc/server + - controller/discoverymgr/mnedc/tunmgr - controller/storagemgr/storagedriver - db/helper - db/bolt/common diff --git a/src/common/sigmgr/sigmgr.go b/src/common/sigmgr/sigmgr.go index ab9321e8..a535e077 100644 --- a/src/common/sigmgr/sigmgr.go +++ b/src/common/sigmgr/sigmgr.go @@ -23,8 +23,8 @@ import ( "os/signal" "syscall" - "controller/mnedcmgr/client" - "controller/mnedcmgr/server" + "controller/discoverymgr/mnedc/client" + "controller/discoverymgr/mnedc/server" ) const ( diff --git a/src/controller/discoverymgr/discovery.go b/src/controller/discoverymgr/discovery.go index a39424cc..6eb63457 100644 --- a/src/controller/discoverymgr/discovery.go +++ b/src/controller/discoverymgr/discovery.go @@ -28,6 +28,7 @@ import ( errors "common/errors" networkhelper "common/networkhelper" + mnedc "controller/discoverymgr/mnedc" wrapper "controller/discoverymgr/wrapper" configurationdb "db/bolt/configuration" @@ -56,6 +57,8 @@ type Discovery interface { NotifyMNEDCBroadcastServer() error MNEDCReconciledCallback() GetDeviceID() (id string, err error) + StartMNEDCClient(string, string) + StartMNEDCServer(string) client.Setter cipher.Setter } @@ -383,7 +386,6 @@ func setDeviceID(UUIDPath string) (UUIDstr string, err error) { return UUIDstr, err } - func getPlatform() (platform string, err error) { platform, err = getSystemDB(systemdb.Platform) if err != nil { @@ -686,6 +688,16 @@ func (d *DiscoveryImpl) MNEDCReconciledCallback() { } } +//StartMNEDCClient Starts MNEDC client +func (d *DiscoveryImpl) StartMNEDCClient(deviceIDFilePath, mnedcServerConfig string) { + mnedc.GetClientInstance().StartMNEDCClient(deviceIDFilePath, mnedcServerConfig) +} + +//StartMNEDCServer Starts MNEDC server +func (d *DiscoveryImpl) StartMNEDCServer(deviceIDFilePath string) { + mnedc.GetServerInstance().StartMNEDCServer(deviceIDFilePath) +} + // ClearMap makes map empty and only leaves my device info func clearMap() { log.Println(logPrefix, "[clearMap]") @@ -819,4 +831,4 @@ func activeDiscovery() { // It Clears Map func resetServer(ips []net.IP) { wrapperIns.ResetServer(ips) -} \ No newline at end of file +} diff --git a/src/controller/mnedcmgr/client/client.go b/src/controller/discoverymgr/mnedc/client/client.go similarity index 81% rename from src/controller/mnedcmgr/client/client.go rename to src/controller/discoverymgr/mnedc/client/client.go index 778bc7f0..fbd33d0e 100644 --- a/src/controller/mnedcmgr/client/client.go +++ b/src/controller/discoverymgr/mnedc/client/client.go @@ -26,9 +26,11 @@ import ( "sync" "time" - "controller/discoverymgr" - "controller/mnedcmgr/connectionutil" - "controller/mnedcmgr/tunmgr" + restclient "restinterface/client" + //"controller/discoverymgr" + networkhelper "common/networkhelper" + "controller/discoverymgr/mnedc/connectionutil" + "controller/discoverymgr/mnedc/tunmgr" "github.com/songgao/water" ) @@ -61,18 +63,21 @@ type Client struct { serverPort string deviceID string configPath string + clientAPI restclient.Clienter } var ( clientIns *Client tunIns tunmgr.Tun networkUtilIns connectionutil.NetworkUtil - discoveryIns discoverymgr.Discovery + networkIns networkhelper.Network + //discoveryIns discoverymgr.Discovery ) const ( - waitDelay = 150 * time.Millisecond - retryDelay = 5 * time.Second + waitDelay = 150 * time.Millisecond + retryDelay = 5 * time.Second + mnedcBroadcastServerPort = 3333 ) //MNEDCClient declares methods related to MNEDC client @@ -88,13 +93,16 @@ type MNEDCClient interface { ParseVirtualIP(string) error TunReadRoutine() TunWriteRoutine() + NotifyBroadcastServer(configPath string) error + SetClient(clientAPI restclient.Clienter) } func init() { clientIns = &Client{} tunIns = tunmgr.GetInstance() networkUtilIns = connectionutil.GetInstance() - discoveryIns = discoverymgr.GetInstance() + networkIns = networkhelper.GetInstance() + //discoveryIns = discoverymgr.GetInstance() } //GetInstance returns MNEDCClient interface instance @@ -403,14 +411,73 @@ func (c *Client) TunWriteRoutine() { func (c *Client) NotifyClose() { logPrefix := "[NotifyClose]" log.Println(logPrefix, "MNEDC connection closed") - discoveryIns.MNEDCClosedCallback() + //discoveryIns.MNEDCClosedCallback() } //ConnectionReconciled handles the case when MNEDC connection is re-established func (c *Client) ConnectionReconciled() { logPrefix := "[connectionReIstablish]" log.Println(logPrefix, "MNEDC connection reistablished") - discoveryIns.MNEDCReconciledCallback() + //discoveryIns.MNEDCReconciledCallback() + //notifyBroadcastServer() + c.NotifyBroadcastServer(c.configPath) +} + +//NotifyBroadcastServer sends request to broadcast server +func (c *Client) NotifyBroadcastServer(configPath string) error { + logPrefix := "[RegisterBroadcast]" + log.Println(logTag, "Registering to Broadcast server") + c.configPath = configPath + virtualIP, err := networkIns.GetVirtualIP() + if err != nil { + log.Println(logPrefix, "Cant register to Broadcast server, virtual IP error", err.Error()) + return err + } + + privateIP, err := networkIns.GetOutboundIP() + if err != nil { + log.Println(logPrefix, "Cant register to Broadcast server, outbound IP error", err.Error()) + return err + } + + file, err := os.Open(configPath) + + if err != nil { + log.Println(logPrefix, "cant read config file from", configPath, err.Error()) + return err + } + defer file.Close() + + scanner := bufio.NewScanner(file) + scanner.Split(bufio.ScanLines) + + scanner.Scan() + serverIP := scanner.Text() + + go func() { + + if c.clientAPI == nil { + log.Println(logPrefix, "Client is nil, returning") + err = errors.New("Client is nil") + return + } + err = c.clientAPI.DoNotifyMNEDCBroadcastServer(serverIP, mnedcBroadcastServerPort, c.deviceID, privateIP, virtualIP) + if err != nil { + log.Println(logPrefix, "Cannot register to Broadcast server", err.Error()) + } + }() + + time.Sleep(5 * time.Second) + if err != nil { + return err + } + + return nil +} + +//SetClient sets the rest client +func (c *Client) SetClient(clientAPI restclient.Clienter) { + c.clientAPI = clientAPI } func getMNEDCServerAddress(path string) (string, string, error) { diff --git a/src/controller/mnedcmgr/client/client_test.go b/src/controller/discoverymgr/mnedc/client/client_test.go similarity index 99% rename from src/controller/mnedcmgr/client/client_test.go rename to src/controller/discoverymgr/mnedc/client/client_test.go index e502b6bf..63c95c5a 100644 --- a/src/controller/mnedcmgr/client/client_test.go +++ b/src/controller/discoverymgr/mnedc/client/client_test.go @@ -28,9 +28,9 @@ import ( "github.com/golang/mock/gomock" "github.com/songgao/water" + networkUtilMocks "controller/discoverymgr/mnedc/connectionutil/mocks" discoveryMocks "controller/discoverymgr/mocks" - networkUtilMocks "controller/mnedcmgr/connectionutil/mocks" - tunMocks "controller/mnedcmgr/tunmgr/mocks" + tunMocks "controller/discoverymgr/mnedc/tunmgr/mocks" ) const ( diff --git a/src/controller/mnedcmgr/client/mocks/mocks_client.go b/src/controller/discoverymgr/mnedc/client/mocks/mocks_client.go similarity index 98% rename from src/controller/mnedcmgr/client/mocks/mocks_client.go rename to src/controller/discoverymgr/mnedc/client/mocks/mocks_client.go index d39c6bf6..466ea296 100644 --- a/src/controller/mnedcmgr/client/mocks/mocks_client.go +++ b/src/controller/discoverymgr/mnedc/client/mocks/mocks_client.go @@ -16,13 +16,13 @@ *******************************************************************************/ // Code generated by MockGen. DO NOT EDIT. -// Source: controller/mnedcmgr/client (interfaces: MNEDCClient) +// Source: controller/discoverymgr/mnedc/client (interfaces: MNEDCClient) // Package mocks is a generated GoMock package. package mocks import ( - client "controller/mnedcmgr/client" + client "controller/discoverymgr/mnedc/client" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/src/controller/mnedcmgr/clientcontrol.go b/src/controller/discoverymgr/mnedc/clientcontrol.go similarity index 68% rename from src/controller/mnedcmgr/clientcontrol.go rename to src/controller/discoverymgr/mnedc/clientcontrol.go index ad193c6b..1ec75cdf 100644 --- a/src/controller/mnedcmgr/clientcontrol.go +++ b/src/controller/discoverymgr/mnedc/clientcontrol.go @@ -18,29 +18,32 @@ package mnedcmgr import ( + "io/ioutil" "log" "restinterface/tls" "time" - "controller/discoverymgr" - "controller/mnedcmgr/client" + restclient "restinterface/client" + //"controller/discoverymgr" + "controller/discoverymgr/mnedc/client" ) //ClientImpl structure type ClientImpl struct { + clientAPI restclient.Clienter tls.HasCertificate } var ( clientIns *ClientImpl mnedcClientIns client.MNEDCClient - discoveryIns discoverymgr.Discovery + //discoveryIns discoverymgr.Discovery ) func init() { clientIns = new(ClientImpl) mnedcClientIns = client.GetInstance() - discoveryIns = discoverymgr.GetInstance() + //discoveryIns = discoverymgr.GetInstance() } // GetClientInstance gives the ClientImpl singletone instance @@ -51,12 +54,15 @@ func GetClientInstance() *ClientImpl { //StartMNEDCClient starts the MNEDC client func (c *ClientImpl) StartMNEDCClient(deviceIDPath string, configPath string) { - deviceID, err := discoveryIns.GetDeviceID() + //deviceID, err := discoveryIns.GetDeviceID() + deviceID, err := getDeviceID(configPath) if err != nil { log.Println(logPrefix, "Couldn't start MNEDC client", err.Error()) return } + mnedcClientIns.SetClient(c.clientAPI) + err = c.RegisterToMNEDCServer(deviceID, configPath) if err != nil { log.Println(logPrefix, "Couldn't start MNEDC client", err.Error()) @@ -64,7 +70,8 @@ func (c *ClientImpl) StartMNEDCClient(deviceIDPath string, configPath string) { } for attempts := 0; attempts <= maxAttempts; attempts++ { - err := discoveryIns.NotifyMNEDCBroadcastServer() + //err := discoveryIns.NotifyMNEDCBroadcastServer() + err := mnedcClientIns.NotifyBroadcastServer(configPath) if err != nil { log.Println(logPrefix, "Registering to Broadcast server Error", err.Error(), ", retrying") time.Sleep(2 * time.Second) @@ -83,3 +90,24 @@ func (c *ClientImpl) RegisterToMNEDCServer(deviceID string, configPath string) e mnedcClientIns.Run() return nil } + +//SetClient sets the client API +func (c *ClientImpl) SetClient(clientAPI restclient.Clienter) { + c.clientAPI = clientAPI + //mnedcClientIns.SetClient(clientAPI) +} + +func getDeviceID(path string) (string, error) { + logPrefix := "[GetDeviceID]" + UUIDv4, err := ioutil.ReadFile(path) + + if err != nil { + log.Println(logPrefix, "No saved UUID : ", err.Error()) + return "", err + } + + log.Println(logPrefix, "Got the UUID") + UUIDstr := "edge-orchestration-" + string(UUIDv4) + + return UUIDstr, nil +} diff --git a/src/controller/mnedcmgr/clientcontrol_test.go b/src/controller/discoverymgr/mnedc/clientcontrol_test.go similarity index 95% rename from src/controller/mnedcmgr/clientcontrol_test.go rename to src/controller/discoverymgr/mnedc/clientcontrol_test.go index 6f701fbe..b7302022 100644 --- a/src/controller/mnedcmgr/clientcontrol_test.go +++ b/src/controller/discoverymgr/mnedc/clientcontrol_test.go @@ -21,9 +21,9 @@ import ( "errors" "testing" + "controller/discoverymgr/mnedc/client" + clientMocks "controller/discoverymgr/mnedc/client/mocks" discoveryMocks "controller/discoverymgr/mocks" - "controller/mnedcmgr/client" - clientMocks "controller/mnedcmgr/client/mocks" "github.com/golang/mock/gomock" ) diff --git a/src/controller/mnedcmgr/connectionutil/mocks/mocks_connection.go b/src/controller/discoverymgr/mnedc/connectionutil/mocks/mocks_connection.go similarity index 97% rename from src/controller/mnedcmgr/connectionutil/mocks/mocks_connection.go rename to src/controller/discoverymgr/mnedc/connectionutil/mocks/mocks_connection.go index 7ac48c63..abfefc72 100644 --- a/src/controller/mnedcmgr/connectionutil/mocks/mocks_connection.go +++ b/src/controller/discoverymgr/mnedc/connectionutil/mocks/mocks_connection.go @@ -16,7 +16,7 @@ *******************************************************************************/ // Code generated by MockGen. DO NOT EDIT. -// Source: controller/mnedcmgr/connectionutil (interfaces: NetworkUtil) +// Source: controller/discoverymgr/mnedc/connectionutil (interfaces: NetworkUtil) // Package mocks is a generated GoMock package. package mocks diff --git a/src/controller/mnedcmgr/connectionutil/networkconnectionutil.go b/src/controller/discoverymgr/mnedc/connectionutil/networkconnectionutil.go similarity index 100% rename from src/controller/mnedcmgr/connectionutil/networkconnectionutil.go rename to src/controller/discoverymgr/mnedc/connectionutil/networkconnectionutil.go diff --git a/src/controller/mnedcmgr/server/client_conn.go b/src/controller/discoverymgr/mnedc/server/client_conn.go similarity index 100% rename from src/controller/mnedcmgr/server/client_conn.go rename to src/controller/discoverymgr/mnedc/server/client_conn.go diff --git a/src/controller/mnedcmgr/server/client_conn_test.go b/src/controller/discoverymgr/mnedc/server/client_conn_test.go similarity index 98% rename from src/controller/mnedcmgr/server/client_conn_test.go rename to src/controller/discoverymgr/mnedc/server/client_conn_test.go index 50baf719..2e4a1837 100644 --- a/src/controller/mnedcmgr/server/client_conn_test.go +++ b/src/controller/discoverymgr/mnedc/server/client_conn_test.go @@ -27,8 +27,8 @@ import ( "github.com/golang/mock/gomock" "github.com/songgao/water" - networkUtilMocks "controller/mnedcmgr/connectionutil/mocks" - tunMocks "controller/mnedcmgr/tunmgr/mocks" + networkUtilMocks "controller/discoverymgr/mnedc/connectionutil/mocks" + tunMocks "controller/discoverymgr/mnedc/tunmgr/mocks" ) var ( diff --git a/src/controller/mnedcmgr/server/mocks/mocks_server.go b/src/controller/discoverymgr/mnedc/server/mocks/mocks_server.go similarity index 98% rename from src/controller/mnedcmgr/server/mocks/mocks_server.go rename to src/controller/discoverymgr/mnedc/server/mocks/mocks_server.go index 7eb5b827..d5c17694 100644 --- a/src/controller/mnedcmgr/server/mocks/mocks_server.go +++ b/src/controller/discoverymgr/mnedc/server/mocks/mocks_server.go @@ -16,13 +16,13 @@ *******************************************************************************/ // Code generated by MockGen. DO NOT EDIT. -// Source: controller/mnedcmgr/server (interfaces: MNEDCServer) +// Source: controller/discoverymgr/mnedc/server (interfaces: MNEDCServer) // Package mocks is a generated GoMock package. package mocks import ( - server "controller/mnedcmgr/server" + server "controller/discoverymgr/mnedc/server" gomock "github.com/golang/mock/gomock" net "net" reflect "reflect" diff --git a/src/controller/mnedcmgr/server/server.go b/src/controller/discoverymgr/mnedc/server/server.go similarity index 99% rename from src/controller/mnedcmgr/server/server.go rename to src/controller/discoverymgr/mnedc/server/server.go index 1a0e7950..263b184c 100644 --- a/src/controller/mnedcmgr/server/server.go +++ b/src/controller/discoverymgr/mnedc/server/server.go @@ -24,8 +24,8 @@ import ( "strconv" "sync" - "controller/mnedcmgr/connectionutil" - "controller/mnedcmgr/tunmgr" + "controller/discoverymgr/mnedc/connectionutil" + "controller/discoverymgr/mnedc/tunmgr" "github.com/songgao/water" "github.com/songgao/water/waterutil" diff --git a/src/controller/mnedcmgr/servercontrol.go b/src/controller/discoverymgr/mnedc/servercontrol.go similarity index 97% rename from src/controller/mnedcmgr/servercontrol.go rename to src/controller/discoverymgr/mnedc/servercontrol.go index b7e6247a..6893c7db 100644 --- a/src/controller/mnedcmgr/servercontrol.go +++ b/src/controller/discoverymgr/mnedc/servercontrol.go @@ -24,7 +24,7 @@ import ( "strconv" networkhelper "common/networkhelper" - "controller/mnedcmgr/server" + "controller/discoverymgr/mnedc/server" "restinterface/cipher" "restinterface/resthelper" "restinterface/route/tlspskserver" @@ -59,7 +59,8 @@ func GetServerInstance() *ServerImpl { //StartMNEDCServer starts the MNEDC server on the machine func (ServerImpl) StartMNEDCServer(deviceIDPath string) { - deviceID, err := discoveryIns.GetDeviceID() + //deviceID, err := discoveryIns.GetDeviceID() + deviceID, err := getDeviceID(deviceIDPath) if err != nil { log.Println(logPrefix, "Couldn't start MNEDC server", err.Error()) return diff --git a/src/controller/mnedcmgr/servercontrol_test.go b/src/controller/discoverymgr/mnedc/servercontrol_test.go similarity index 98% rename from src/controller/mnedcmgr/servercontrol_test.go rename to src/controller/discoverymgr/mnedc/servercontrol_test.go index 5489ccfc..549a7a59 100644 --- a/src/controller/mnedcmgr/servercontrol_test.go +++ b/src/controller/discoverymgr/mnedc/servercontrol_test.go @@ -28,8 +28,8 @@ import ( networkmocks "common/networkhelper/mocks" discoverymocks "controller/discoverymgr/mocks" - "controller/mnedcmgr/server" - serverMocks "controller/mnedcmgr/server/mocks" + "controller/discoverymgr/mnedc/server" + serverMocks "controller/discoverymgr/mnedc/server/mocks" ciphermock "restinterface/cipher/mocks" helpermock "restinterface/resthelper/mocks" diff --git a/src/controller/mnedcmgr/tunmgr/mocks/mocks_tun.go b/src/controller/discoverymgr/mnedc/tunmgr/mocks/mocks_tun.go similarity index 97% rename from src/controller/mnedcmgr/tunmgr/mocks/mocks_tun.go rename to src/controller/discoverymgr/mnedc/tunmgr/mocks/mocks_tun.go index 1ff028d8..3fa2f7db 100644 --- a/src/controller/mnedcmgr/tunmgr/mocks/mocks_tun.go +++ b/src/controller/discoverymgr/mnedc/tunmgr/mocks/mocks_tun.go @@ -16,7 +16,7 @@ *******************************************************************************/ // Code generated by MockGen. DO NOT EDIT. -// Source: controller/mnedcmgr/tunmgr (interfaces: Tun) +// Source: controller/discoverymgr/mnedc/tunmgr (interfaces: Tun) // Package mocks is a generated GoMock package. package mocks diff --git a/src/controller/mnedcmgr/tunmgr/tun.go b/src/controller/discoverymgr/mnedc/tunmgr/tun.go similarity index 100% rename from src/controller/mnedcmgr/tunmgr/tun.go rename to src/controller/discoverymgr/mnedc/tunmgr/tun.go diff --git a/src/controller/mnedcmgr/types.go b/src/controller/discoverymgr/mnedc/types.go similarity index 100% rename from src/controller/mnedcmgr/types.go rename to src/controller/discoverymgr/mnedc/types.go diff --git a/src/interfaces/capi/main.go b/src/interfaces/capi/main.go index 9397d12f..2b72f996 100644 --- a/src/interfaces/capi/main.go +++ b/src/interfaces/capi/main.go @@ -86,7 +86,7 @@ import ( configuremgr "controller/configuremgr/native" "controller/discoverymgr" - "controller/mnedcmgr" + mnedcmgr "controller/discoverymgr/mnedc" scoringmgr "controller/scoringmgr" "controller/securemgr/authenticator" "controller/securemgr/authorizer"