Skip to content

Commit

Permalink
Merge pull request #33 from napptive/feature/List_private_catalog
Browse files Browse the repository at this point in the history
List private namespace
  • Loading branch information
Carmendelope authored Jul 21, 2021
2 parents 0afdfdf + 4ae3617 commit ae924e1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/pkg/server/catalog-manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package catalog_manager

import (
"fmt"
"strings"

"github.com/napptive/catalog-manager/internal/pkg/entities"
Expand Down Expand Up @@ -213,8 +214,17 @@ func (m *manager) Get(requestedAppID string) (*entities.ExtendedApplicationMetad
}

// List returns a list of applications (without metadata and readme content)
// List ([catalogURL/]namespace)
func (m *manager) List(namespace string) ([]*entities.AppSummary, error) {
return m.provider.ListSummary(namespace)
// TODO: Check if the catalogURL matches with repositoryName
// DecomposeApplicationID needs [catalogURL/]namespace/appName[:tag]
// in this case we have no appName, uses dummyAppName to simulate it
_, appID, err := utils.DecomposeApplicationID(fmt.Sprintf("%s/dummyAppName", namespace))
if err != nil {
return nil, nerrors.NewFailedPreconditionErrorFrom(err, "unable to list applications")
}

return m.provider.ListSummary(appID.Namespace)
}

// Summary returns catalog summary
Expand Down

0 comments on commit ae924e1

Please sign in to comment.