Fixed a url replacement bug for versions

This commit is contained in:
Frikky
2026-02-11 13:49:21 +01:00
parent cd4ddcc2a0
commit aeadf7706e
+13 -3
View File
@@ -121,9 +121,6 @@ var autoDeploy = map[string]string{
// "shuffle-tools-fork:1.0.0": "frikky/shuffle:shuffle-tools-fork_1.0.0",
}
//"testing:1.0.0": "frikky/shuffle:testing_1.0.0",
//fmt.Sprintf("%s_%s", workflowExecution.ExecutionId, action.ID)
// New Worker mappings
// visited, appendActions, nextActions, notFound, queueNodes, toRemove, executed, env
var portMappings map[string]int
@@ -4043,6 +4040,19 @@ func sendAppRequest(ctx context.Context, incomingUrl, appName string, port int,
appName = strings.Replace(appName, "_", "-", -1)
}
// Shitty hardcoded fix for now
if strings.Contains(appName, "1.0.0") {
appName = strings.Replace(appName, "1.0.0", "1-0-0", 1)
} else if strings.Contains(appName, "1.1.0") {
appName = strings.Replace(appName, "1.1.0", "1-1-0", 1)
} else if strings.Contains(appName, "1.2.0") {
appName = strings.Replace(appName, "1.2.0", "1-2-0", 1)
} else if strings.Contains(appName, "1.4.0") {
appName = strings.Replace(appName, "1.4.0", "1-4-0", 1)
} else if strings.Contains(appName, "2.0.0") {
appName = strings.Replace(appName, "2.0.0", "2-0-0", 1)
}
streamUrl := fmt.Sprintf("http://%s:%d/api/v1/run", appName, port)
// log.Printf("[DEBUG][%s] Worker URL: %s, Backend URL: %s, Target App: %s", workflowExecution.ExecutionId, parsedRequest.BaseUrl, parsedRequest.Url, streamUrl)
req, err := http.NewRequest(