Allowed workflow reruns from a specific node

This commit is contained in:
Frikky
2025-03-24 20:59:44 +01:00
parent 9b9e2e1048
commit a2e4d37eea
2 changed files with 18 additions and 3 deletions
+9 -1
View File
@@ -647,7 +647,15 @@ func getDockerImage(resp http.ResponseWriter, request *http.Request) {
alternativeName = strings.Join(alternativeNameSplit[1:3], "/")
}
log.Printf("[INFO] Trying to download image: %s. Alt: %s", version.Name, alternativeName)
if len(version.Name) == 0 {
log.Printf("[ERROR] No image name provided for download: %s", version.Name)
resp.WriteHeader(401)
resp.Write([]byte(fmt.Sprintf(`{"success": false, "message": "No image name"}`)))
return
}
log.Printf("[INFO] Trying to download image: '%s'. Alt name: %#v", version.Name, alternativeName)
for _, image := range images {
for _, tag := range image.RepoTags {
+9 -2
View File
@@ -3041,9 +3041,16 @@ func executeSingleAction(resp http.ResponseWriter, request *http.Request) {
return
}
time.Sleep(2 * time.Second)
log.Printf("[INFO] Starting validation of execution %s", workflowExecution.ExecutionId)
if shouldRerun {
log.Printf("[DEBUG] Returning single action execution ID for rerun: %s", workflowExecution.ExecutionId)
resp.WriteHeader(200)
resp.Write([]byte(fmt.Sprintf(`{"success": true, "execution_id": "%s", "authorization": "%s"}`, workflowExecution.ExecutionId, workflowExecution.Authorization)))
return
}
log.Printf("[INFO] Starting validation of execution %s", workflowExecution.ExecutionId)
time.Sleep(2 * time.Second)
returnBody := shuffle.HandleRetValidation(ctx, workflowExecution, 1)
returnBytes, err := json.Marshal(returnBody)
if err != nil {