Skip to content

Commit

Permalink
Update the resource url in db during catalog refresh
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
SM43 authored and tekton-robot committed Mar 19, 2021
1 parent 7afb774 commit b3daf98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/pkg/service/catalog/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}).
Expand All @@ -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)
Expand Down

0 comments on commit b3daf98

Please sign in to comment.