Skip to content

Commit

Permalink
update to new href
Browse files Browse the repository at this point in the history
  • Loading branch information
rverdile committed Jan 23, 2024
1 parent cf719bd commit 2ff9d37
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ if err != nil {
defer t.Close()

// Use Tangy to search for RPMs, by name, that are associated to a specific repository version, returning up to the first 100 results
versionHref := "/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
versionHref := "/api/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
rows, err := t.RpmRepositoryVersionPackageSearch(context.Background(), []string{versionHref}, "bear", 100)
if err != nil {
return err
}

// Use Tangy to search for RPM Package Groups, by name, that are associated to a specific repository version, returning up to the first 100 results
versionHref := "/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
versionHref := "/api/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
rows, err := t.RpmRepositoryVersionPackageGroupSearch(context.Background(), []string{versionHref}, "mammals", 100)
if err != nil {
return err
}

// Use Tangy to search for RPM Environments, by name, that are associated to a specific repository version, returning up to the first 100 results
versionHref := "/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
versionHref := "/api/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/"
rows, err := t.RpmRepositoryVersionPackageGroupSearch(context.Background(), []string{versionHref}, "animals", 100)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions compose_files/pulp/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ services:
POSTGRES_SERVICE_PORT: 5432
POSTGRES_SERVICE_HOST: postgres
PULP_DOMAIN_ENABLED: "true"
PULP_API_ROOT: /api/pulp/
restart: always

pulp_web:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/content-services/tang
go 1.20

require (
github.com/content-services/zest/release/v2023 v2023.11.1701177874
github.com/content-services/zest/release/v2024 v2024.1.1706018763
github.com/google/uuid v1.4.0
github.com/jackc/pgx-zerolog v0.0.0-20230315001418-f978528409eb
github.com/jackc/pgx/v5 v5.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/content-services/zest/release/v2023 v2023.11.1701177874 h1:yC5uRkU78UtVe3oTn0pRwT9KBd9b4SBAfQ9QTargCqg=
github.com/content-services/zest/release/v2023 v2023.11.1701177874/go.mod h1:9pesd98rUBOqg1z2UL65NA1+zZQRcFJY3VIdimAJxL8=
github.com/content-services/zest/release/v2024 v2024.1.1706018763 h1:TrFMpNk1SaTgxmdh7PggnEGmAZZoKS7oOhqSeNlkxf0=
github.com/content-services/zest/release/v2024 v2024.1.1706018763/go.mod h1:UwNlzoIpFWKjR3yPnm+l4GtShPYLhWy9Rt+jmFM5W/U=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
2 changes: 1 addition & 1 deletion internal/zestwrapper/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/content-services/tang/internal/config"
zest "github.com/content-services/zest/release/v2023"
zest "github.com/content-services/zest/release/v2024"
"golang.org/x/exp/slices"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/tangy/rpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ func buildSearchQuery(queryFragment string, search string, limit int, repository
}

func parseRepositoryVersionHrefs(hrefs []string) (repositoryIDs []string, versions []int, err error) {
// /pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/
// /api/pulp/e1c6bee3/api/v3/repositories/rpm/rpm/018c1c95-4281-76eb-b277-842cbad524f4/versions/1/
for _, href := range hrefs {
splitHref := strings.Split(href, "/")
if len(splitHref) < 10 {
return nil, nil, fmt.Errorf("%v is not a valid href", splitHref)
}
id := splitHref[8]
num := splitHref[10]
id := splitHref[9]
num := splitHref[11]

_, err = uuid.Parse(id)
if err != nil {
Expand Down

0 comments on commit 2ff9d37

Please sign in to comment.