fixes some of the issue in 2.1.0-rc2

This commit is contained in:
yashsinghcodes
2025-06-26 02:47:29 +05:30
parent 98c3480aba
commit 00ffd7bfa8
2 changed files with 16 additions and 15 deletions
+2 -2
View File
@@ -280,7 +280,7 @@ func handleGetWorkflowqueue(resp http.ResponseWriter, request *http.Request) {
//log.Printf("[AUDIT] Get workflow queue for org %s, env %s, orborus label %s", orgId, environment, orborusLabel) //log.Printf("[AUDIT] Get workflow queue for org %s, env %s, orborus label %s", orgId, environment, orborusLabel)
ctx := shuffle.GetContext(request) ctx := shuffle.GetContext(request)
env, err := shuffle.GetEnvironment(ctx, orgId, "") env, err := shuffle.GetEnvironment(ctx, "", orgId)
if err != nil { if err != nil {
log.Printf("[WARNING] No env found matching %s - continuing without updating orborus anyway: %s", orgId, err) log.Printf("[WARNING] No env found matching %s - continuing without updating orborus anyway: %s", orgId, err)
} }
@@ -477,7 +477,7 @@ func handleGetWorkflowqueue(resp http.ResponseWriter, request *http.Request) {
} }
if len(orgId) > 0 { if len(orgId) > 0 {
env, err := shuffle.GetEnvironment(ctx, orgId, foundId) env, err := shuffle.GetEnvironment(ctx, foundId, orgId)
if err != nil { if err != nil {
log.Printf("[WARNING] No env found matching %s - continuing without updating orborus anyway: %s", orgId, err) log.Printf("[WARNING] No env found matching %s - continuing without updating orborus anyway: %s", orgId, err)
//resp.WriteHeader(401) //resp.WriteHeader(401)
+14 -13
View File
@@ -813,20 +813,20 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
newImages = append(newImages, curimage) newImages = append(newImages, curimage)
// Force remove the current image to avoid cached layers // Force remove the current image to avoid cached layers
if swarmConfig == "run" || swarmConfig == "swarm" { // if swarmConfig == "run" || swarmConfig == "swarm" {
_, err := dockercli.ImageRemove(ctx, curimage, image.RemoveOptions{ // _, err := dockercli.ImageRemove(ctx, curimage, image.RemoveOptions{
Force: true, // Force: true,
PruneChildren: true, // PruneChildren: true,
}) // })
if err != nil { // if err != nil {
log.Printf("[ERROR] Failed removing image for re-download: %s", err) // log.Printf("[ERROR] Failed removing image for re-download: %s", err)
} else { // } else {
log.Printf("[DEBUG] Removed image: %s", curimage) // log.Printf("[DEBUG] Removed image: %s", curimage)
} // }
} else { // } else {
//log.Printf("[DEBUG] Skipping image removal for %s as swarmConfig is not set to run or swarm. Value: %#v", curimage, swarmConfig) // //log.Printf("[DEBUG] Skipping image removal for %s as swarmConfig is not set to run or swarm. Value: %#v", curimage, swarmConfig)
} // }
err := shuffle.DownloadDockerImageBackend(&http.Client{Timeout: imagedownloadTimeout}, curimage) err := shuffle.DownloadDockerImageBackend(&http.Client{Timeout: imagedownloadTimeout}, curimage)
if err != nil { if err != nil {
@@ -874,6 +874,7 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
// Update the service to run with the new image // Update the service to run with the new image
//docker service update --image username/imagename:latest servicename --force //docker service update --image username/imagename:latest servicename --force
serviceUpdateOptions := types.ServiceUpdateOptions{} serviceUpdateOptions := types.ServiceUpdateOptions{}
service.Spec.TaskTemplate.ForceUpdate++
resp, err := dockercli.ServiceUpdate( resp, err := dockercli.ServiceUpdate(
ctx, ctx,
service.ID, service.ID,