Skip to content

Commit

Permalink
fix(fsi): canonicalize alias before fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Jul 24, 2019
1 parent f319452 commit 073c640
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 0 additions & 2 deletions api/fsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ func (h *FSIHandlers) statusHandler(w http.ResponseWriter, r *http.Request) {
util.WriteResponse(w, res)
}



// LinksHandler is the endpoint for getting the list of fsi-linked datasets
func (h *FSIHandlers) LinksHandler(w http.ResponseWriter, r *http.Request) {
switch r.Method {
Expand Down
11 changes: 11 additions & 0 deletions fsi/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ func (fsi *FSI) AliasStatus(alias string) (changes []StatusItem, err error) {
return nil, err
}

ref, err := repo.ParseDatasetRef(alias)
if err != nil {
return nil, err
}

if err := repo.CanonicalizeDatasetRef(fsi.repo, &ref); err != nil {
return nil, err
}

alias = ref.AliasString()

for _, l := range links {
if l.Alias == alias {
return fsi.Status(l.Path)
Expand Down

0 comments on commit 073c640

Please sign in to comment.