From 87828958b561f4d0998ce52285e0a076dd8ba7fa Mon Sep 17 00:00:00 2001 From: Bosco Raju Date: Mon, 21 Aug 2023 16:07:35 +0100 Subject: [PATCH] fix(flytectl): Update FetchWorkflowLatestVersion to fetch the latest version of a workflow The FetchWorkflowLatestVersion function in workflow_fetcher.go has been updated to retrieve the latest version of a workflow by using the last element in the wVersions slice. This change ensures that the most recent version is fetched when calling this function. --- pkg/ext/workflow_fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ext/workflow_fetcher.go b/pkg/ext/workflow_fetcher.go index 98438e06..13d5487a 100644 --- a/pkg/ext/workflow_fetcher.go +++ b/pkg/ext/workflow_fetcher.go @@ -49,7 +49,7 @@ func (a *AdminFetcherExtClient) FetchWorkflowLatestVersion(ctx context.Context, if err != nil { return nil, err } - return a.FetchWorkflowVersion(ctx, name, wVersions[0].Id.Version, project, domain) + return a.FetchWorkflowVersion(ctx, name, wVersions[len(wVersions)-1].Id.Version, project, domain) } // FetchWorkflowVersion fetches particular version of workflow