From 21a01cbcdbb81ab5db8759e314ea75e732056b46 Mon Sep 17 00:00:00 2001 From: eyalbe4 Date: Mon, 25 Nov 2024 22:10:10 +0200 Subject: [PATCH 1/2] Fix Get Distribution Export --- lifecycle/services/export.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lifecycle/services/export.go b/lifecycle/services/export.go index 56edcd3b2..223c3faef 100644 --- a/lifecycle/services/export.go +++ b/lifecycle/services/export.go @@ -3,10 +3,11 @@ package services import ( "encoding/json" "fmt" + "path" + "github.com/jfrog/jfrog-client-go/utils/errorutils" "github.com/jfrog/jfrog-client-go/utils/io/httputils" "github.com/jfrog/jfrog-client-go/utils/log" - "path" ) const ( @@ -101,8 +102,13 @@ func (rbs *ReleaseBundlesService) waitForExport(rbDetails ReleaseBundleDetails, switch response.Status { case ExportProcessing: return false, nil, nil - case ExportCompleted, ExportFailed: + case ExportFailed: return true, responseBody, nil + case ExportCompleted: + if response.RelativeUrl != "" && response.RelativeUrl != "/" { + return true, responseBody, nil + } + return false, nil, nil default: return true, nil, errorutils.CheckErrorf("received unexpected status: '%s'", response.Status) } From c3acb18f34977dc26f9af5871f8964334155e520 Mon Sep 17 00:00:00 2001 From: eyalbe4 Date: Thu, 28 Nov 2024 18:14:47 +0200 Subject: [PATCH 2/2] Also added a check for the download URL --- lifecycle/services/export.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lifecycle/services/export.go b/lifecycle/services/export.go index 223c3faef..1d98dd0a9 100644 --- a/lifecycle/services/export.go +++ b/lifecycle/services/export.go @@ -105,7 +105,8 @@ func (rbs *ReleaseBundlesService) waitForExport(rbDetails ReleaseBundleDetails, case ExportFailed: return true, responseBody, nil case ExportCompleted: - if response.RelativeUrl != "" && response.RelativeUrl != "/" { + if response.RelativeUrl != "" && response.RelativeUrl != "/" && + response.DownloadUrl != "" { return true, responseBody, nil } return false, nil, nil