From b3daf986ffe83ec3c28653a0b52c9e51acd3b2ca Mon Sep 17 00:00:00 2001 From: SM43 Date: Fri, 19 Mar 2021 17:03:45 +0530 Subject: [PATCH] Update the resource url in db during catalog refresh This will update the resource url in db if it is changed, as while changing branch from master to main, the url is not getting changed due to this. Signed-off-by: Shivam Mukhade --- api/pkg/service/catalog/syncer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pkg/service/catalog/syncer.go b/api/pkg/service/catalog/syncer.go index 3debf46c30..512cdade8f 100644 --- a/api/pkg/service/catalog/syncer.go +++ b/api/pkg/service/catalog/syncer.go @@ -296,7 +296,6 @@ func (s *syncer) updateResourceVersions( ver := model.ResourceVersion{ Version: v.Version, ResourceID: resourceID, - URL: fmt.Sprintf("%s/tree/%s/%s", catalog.URL, catalog.Revision, v.Path), } txn.Model(&model.ResourceVersion{}). @@ -306,6 +305,7 @@ func (s *syncer) updateResourceVersions( ver.Description = v.Description ver.ModifiedAt = v.ModifiedAt ver.MinPipelinesVersion = v.MinPipelinesVersion + ver.URL = fmt.Sprintf("%s/tree/%s/%s", catalog.URL, catalog.Revision, v.Path) txn.Save(&ver) log.Infof(" Version: %d -> %s | Path: %s ", ver.ID, ver.Version, v.Path)