Skip to content

Commit 2dc1fa2

Browse files
committed
(catalogd) Update query endpoint to metas endpoint
The [RFC](https://docs.google.com/document/d/1s6_9IFEKGQLNh3ueH7SF4Yrx4PW9NSiNFqFIJx0pU-8/edit?usp=sharing) was updated to reflect a decision to change the new endpoint from $base/api/v1/query to $base/api/v1/metas. This PR makes that change.
1 parent 68b500b commit 2dc1fa2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: catalogd/internal/storage/localdir.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (s *LocalDirV1) StorageServerHandler() http.Handler {
190190

191191
mux.HandleFunc(s.RootURL.JoinPath("{catalog}", "api", "v1", "all").Path, s.handleV1All)
192192
if s.EnableQueryHandler {
193-
mux.HandleFunc(s.RootURL.JoinPath("{catalog}", "api", "v1", "query").Path, s.handleV1Query)
193+
mux.HandleFunc(s.RootURL.JoinPath("{catalog}", "api", "v1", "metas").Path, s.handleV1Query)
194194
}
195195
allowedMethodsHandler := func(next http.Handler, allowedMethods ...string) http.Handler {
196196
allowedMethodSet := sets.New[string](allowedMethods...)

Diff for: catalogd/internal/storage/localdir_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ func TestQueryEndpoint(t *testing.T) {
338338

339339
for _, tc := range testCases {
340340
t.Run(tc.name, func(t *testing.T) {
341-
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/catalogs/test-catalog/api/v1/query%s", testServer.URL, tc.queryParams), nil)
341+
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/catalogs/test-catalog/api/v1/metas%s", testServer.URL, tc.queryParams), nil)
342342
require.NoError(t, err)
343343

344344
if strings.Contains(tc.name, "If-Modified-Since") {
@@ -397,7 +397,7 @@ func TestServerLoadHandling(t *testing.T) {
397397
var reqs []*http.Request
398398
for i := 0; i < 100; i++ {
399399
req, _ := http.NewRequest(http.MethodGet,
400-
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/query?schema=olm.bundle", baseURL),
400+
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/metas?schema=olm.bundle", baseURL),
401401
nil)
402402
req.Header.Set("Accept", "application/jsonl")
403403
reqs = append(reqs, req)
@@ -422,7 +422,7 @@ func TestServerLoadHandling(t *testing.T) {
422422
var reqs []*http.Request
423423
for i := 0; i < 50; i++ {
424424
req, _ := http.NewRequest(http.MethodGet,
425-
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/query?package=test-op-%d", baseURL, i),
425+
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/metas?package=test-op-%d", baseURL, i),
426426
nil)
427427
req.Header.Set("Accept", "application/jsonl")
428428
reqs = append(reqs, req)
@@ -452,7 +452,7 @@ func TestServerLoadHandling(t *testing.T) {
452452
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/all", baseURL),
453453
nil)
454454
queryReq, _ := http.NewRequest(http.MethodGet,
455-
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/query?schema=olm.bundle", baseURL),
455+
fmt.Sprintf("%s/catalogs/test-catalog/api/v1/metas?schema=olm.bundle", baseURL),
456456
nil)
457457
allReq.Header.Set("Accept", "application/jsonl")
458458
queryReq.Header.Set("Accept", "application/jsonl")

0 commit comments

Comments
 (0)