Commit 9da3eaa0 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

Categorize scenario edge applications as MEC services and fix federation discovery base path

parent 65a9452e
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import (
	"fmt"
	"net/http"
	"net/url"
	"os"
	"strconv"
	"strings"
	"time"
@@ -164,7 +163,7 @@ func msgHandler(msg *mq.Msg, userData interface{}) {
func createAppInstance(proc *dataModel.Process, ctx *mod.NodeContext) (*apps.Application, error) {
	// Determine app type
	appType := apps.TypeUser
	if appCtrl.appStore.IsSysApp(proc.Image) {
	if proc.Type_ == mod.NodeTypeEdgeApp {
		appType = apps.TypeSystem
	}

@@ -727,13 +726,7 @@ func startMECFederationDiscovery(hostUrl string) {
						return
					}
					log.Debug("startMECFederationDiscovery: s: ", s)
					h := os.Getenv("MEEP_HOST_URL")
					if len(h) == 0 {
						log.Error("startMECFederationDiscovery: MEEP_HOST_URL env. variable not set")
						stopMECFederationDiscovery()
						return
					}
					cfg.BasePath = h + "/" + appCtrl.sandboxName + "/" + s[0] + u.Path
					cfg.BasePath = strings.TrimSuffix(k, "/")
					log.Debug("startMECFederationDiscovery: cfg.BasePath: ", cfg.BasePath)
					tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
					cfg.HTTPClient = &http.Client{Transport: tr}
+0 −13
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package applications
import (
	"errors"
	"strconv"
	"strings"
	"sync"

	dkm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr"
@@ -69,8 +68,6 @@ type ApplicationStore struct {
	mutex    sync.Mutex
}

var SysAppNames []string = []string{"meep-app-enablement", "meep-ams", "meep-loc-serv", "meep-dai", "meep-rnis", "meep-federation", "meep-wais", "meep-vis", "meep-iot", "meep-sss"}

// NewApplicationStore - Creates and initialize an Application Store instance
func NewApplicationStore(cfg *ApplicationStoreCfg) (as *ApplicationStore, err error) {
	// Validate params
@@ -230,16 +227,6 @@ func (as *ApplicationStore) Refresh() {
	}
}

func (as *ApplicationStore) IsSysApp(appName string) bool {
	name := appName[strings.LastIndex(appName, "/")+1:]
	for _, sysAppName := range SysAppNames {
		if sysAppName == name {
			return true
		}
	}
	return false
}

func (as *ApplicationStore) setEntry(app *Application) error {
	as.mutex.Lock()
	defer as.mutex.Unlock()