Loading go-apps/meep-tc-engine/server/tc-engine.go +7 −3 Original line number Diff line number Diff line Loading @@ -990,10 +990,14 @@ func applyMgSvcMapping() { // Get Service info from exposed service name // Check if MG Service first svcInfo, found := podInfo.mgSvcMap[svcMap.svcName] if !found { var svcInfo *serviceInfo var found bool if svcInfo, found = podInfo.mgSvcMap[svcMap.svcName]; !found { // If not found, must be unique service svcInfo = svcInfoMap[svcMap.svcName] if svcInfo, found = svcInfoMap[svcMap.svcName]; !found { log.Warn("Failed to find service instance: ", svcMap.svcName) continue } } // Populate rule fields Loading go-apps/meep-virt-engine/server/chart_template.go +31 −29 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { // Parse User Chart Group to find new group services // Create charts only for group services that do not exist yet // Format: <service instance name>:[group service name]:<port>:<protocol> if proc.UserChartGroup != "" { userChartGroup := strings.Split(proc.UserChartGroup, ":") meSvcName := userChartGroup[1] if meSvcName != "" { Loading Loading @@ -183,6 +184,7 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { log.Debug("chart added for user chart group service ", len(charts)) } } } } else { log.Debug("Processing virt-engine chart for element[", proc.Name, "]") Loading Loading @@ -247,10 +249,10 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { // Add ingress Service Maps, if any for _, serviceMap := range proc.ExternalConfig.IngressServiceMap { var ingressSvcMapTemplate ServiceMapTemplate ingressSvcMapTemplate.Name = "ingress-" + proc.Id + "-" + serviceMap.Name ingressSvcMapTemplate.NodePort = strconv.Itoa(int(serviceMap.ExternalPort)) ingressSvcMapTemplate.Port = strconv.Itoa(int(serviceMap.Port)) ingressSvcMapTemplate.Protocol = serviceMap.Protocol ingressSvcMapTemplate.Name = "ingress-" + proc.Id + "-" + ingressSvcMapTemplate.NodePort externalTemplate.IngressServiceMap = append(externalTemplate.IngressServiceMap, ingressSvcMapTemplate) } Loading go-apps/meep-virt-engine/server/virt-engine.go +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ func activateScenario(jsonScenario string) { } func terminateScenario(name string) { // Make sure scenario name is valid if name == "" { log.Warn("Trying to terminate empty scenario") return } // Retrieve list of releases rels, _ := helm.GetReleasesName() var toDelete []helm.Chart Loading go-apps/meep-webhook/webhook.go +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ func loadConfig(configFile string) (*Config, error) { // Retrieve App Name from provided network element name string, if any func getAppName(name string) string { names := bytes.Split([]byte(name), []byte(activeScenarioName+"-")) names := bytes.Split([]byte(name), []byte("meep-"+activeScenarioName+"-")) if len(names) != 2 { return "" } Loading js-apps/meep-frontend/src/js/containers/cfg/cfg-network-element-container.js +13 −2 Original line number Diff line number Diff line Loading @@ -119,6 +119,17 @@ const validateName = (val) => { return null; }; const validateFullName = (val) => { if (val) { if (val.length > 60) { return 'Maximum 60 characters'; } else if (!val.match(/^(([a-z0-9][-a-z0-9.]*)?[a-z0-9])+$/)) { return 'Lowercase alphanumeric or \'-\' or \'.\''; } } return null; }; const validateVariableName = (val) => { if (val) { if (val.length > 30) { Loading Loading @@ -231,7 +242,7 @@ const validateServiceMappingEntry = (entry) => { return [ validateExternalPort(args[0]), validateName(args[1]), validateFullName(args[1]), validatePort(args[2]), validateProtocol(args[3]) ].filter(notNull); Loading @@ -253,7 +264,7 @@ const validateChartGroupEntry = (entry) => { if (args.length !== 4) {return ` ${'Svc instance:svc group name:port:protocol'}`;} return [ validateName(args[0]), validateFullName(args[0]), validateName(args[1]), validatePort(args[2]), validateProtocol(args[3]) Loading Loading
go-apps/meep-tc-engine/server/tc-engine.go +7 −3 Original line number Diff line number Diff line Loading @@ -990,10 +990,14 @@ func applyMgSvcMapping() { // Get Service info from exposed service name // Check if MG Service first svcInfo, found := podInfo.mgSvcMap[svcMap.svcName] if !found { var svcInfo *serviceInfo var found bool if svcInfo, found = podInfo.mgSvcMap[svcMap.svcName]; !found { // If not found, must be unique service svcInfo = svcInfoMap[svcMap.svcName] if svcInfo, found = svcInfoMap[svcMap.svcName]; !found { log.Warn("Failed to find service instance: ", svcMap.svcName) continue } } // Populate rule fields Loading
go-apps/meep-virt-engine/server/chart_template.go +31 −29 Original line number Diff line number Diff line Loading @@ -152,6 +152,7 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { // Parse User Chart Group to find new group services // Create charts only for group services that do not exist yet // Format: <service instance name>:[group service name]:<port>:<protocol> if proc.UserChartGroup != "" { userChartGroup := strings.Split(proc.UserChartGroup, ":") meSvcName := userChartGroup[1] if meSvcName != "" { Loading Loading @@ -183,6 +184,7 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { log.Debug("chart added for user chart group service ", len(charts)) } } } } else { log.Debug("Processing virt-engine chart for element[", proc.Name, "]") Loading Loading @@ -247,10 +249,10 @@ func populateScenarioTemplate(scenario model.Scenario) ([]helm.Chart, error) { // Add ingress Service Maps, if any for _, serviceMap := range proc.ExternalConfig.IngressServiceMap { var ingressSvcMapTemplate ServiceMapTemplate ingressSvcMapTemplate.Name = "ingress-" + proc.Id + "-" + serviceMap.Name ingressSvcMapTemplate.NodePort = strconv.Itoa(int(serviceMap.ExternalPort)) ingressSvcMapTemplate.Port = strconv.Itoa(int(serviceMap.Port)) ingressSvcMapTemplate.Protocol = serviceMap.Protocol ingressSvcMapTemplate.Name = "ingress-" + proc.Id + "-" + ingressSvcMapTemplate.NodePort externalTemplate.IngressServiceMap = append(externalTemplate.IngressServiceMap, ingressSvcMapTemplate) } Loading
go-apps/meep-virt-engine/server/virt-engine.go +6 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,12 @@ func activateScenario(jsonScenario string) { } func terminateScenario(name string) { // Make sure scenario name is valid if name == "" { log.Warn("Trying to terminate empty scenario") return } // Retrieve list of releases rels, _ := helm.GetReleasesName() var toDelete []helm.Chart Loading
go-apps/meep-webhook/webhook.go +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ func loadConfig(configFile string) (*Config, error) { // Retrieve App Name from provided network element name string, if any func getAppName(name string) string { names := bytes.Split([]byte(name), []byte(activeScenarioName+"-")) names := bytes.Split([]byte(name), []byte("meep-"+activeScenarioName+"-")) if len(names) != 2 { return "" } Loading
js-apps/meep-frontend/src/js/containers/cfg/cfg-network-element-container.js +13 −2 Original line number Diff line number Diff line Loading @@ -119,6 +119,17 @@ const validateName = (val) => { return null; }; const validateFullName = (val) => { if (val) { if (val.length > 60) { return 'Maximum 60 characters'; } else if (!val.match(/^(([a-z0-9][-a-z0-9.]*)?[a-z0-9])+$/)) { return 'Lowercase alphanumeric or \'-\' or \'.\''; } } return null; }; const validateVariableName = (val) => { if (val) { if (val.length > 30) { Loading Loading @@ -231,7 +242,7 @@ const validateServiceMappingEntry = (entry) => { return [ validateExternalPort(args[0]), validateName(args[1]), validateFullName(args[1]), validatePort(args[2]), validateProtocol(args[3]) ].filter(notNull); Loading @@ -253,7 +264,7 @@ const validateChartGroupEntry = (entry) => { if (args.length !== 4) {return ` ${'Svc instance:svc group name:port:protocol'}`;} return [ validateName(args[0]), validateFullName(args[0]), validateName(args[1]), validatePort(args[2]), validateProtocol(args[3]) Loading