Skip to content

Commit

Permalink
Add /api prefix for /v3 API (jaegertracing#3178)
Browse files Browse the repository at this point in the history
* Add /api prefix for /v3 API

Signed-off-by: Pavol Loffay <[email protected]>

* Fix test

Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay authored Aug 4, 2021
1 parent 6eb9490 commit 4ad17c5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/all-in-one/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const (
getTraceURL = queryURL + "/api/traces?service=jaeger-query&tag=jaeger-debug-id:debug"
getSamplingStrategyURL = agentURL + "/sampling?service=whatever"

getServicesAPIV3URL = queryURL + "/v3/services"
getServicesAPIV3URL = queryURL + "/api/v3/services"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/query/app/apiv3/grpc_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func RegisterGRPCGateway(ctx context.Context, logger *zap.Logger, r *mux.Router,
if basePath != "/" {
handler = http.StripPrefix(basePath, grpcGatewayMux)
}
r.PathPrefix("/v3/").Handler(handler)
r.PathPrefix("/api/v3/").Handler(handler)

var dialOpts []grpc.DialOption
if grpcTLS.Enabled {
Expand Down
2 changes: 1 addition & 1 deletion cmd/query/app/apiv3/grpc_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func testGRPCGateway(t *testing.T, basePath string, serverTLS tlscfg.Options, cl
require.Equal(t, http.ErrServerClosed, err)
}()
defer httpServer.Shutdown(context.Background())
req, err := http.NewRequest("GET", fmt.Sprintf("http://localhost%s%s/v3/traces/123", strings.Replace(httpLis.Addr().String(), "[::]", "", 1), basePath), nil)
req, err := http.NewRequest("GET", fmt.Sprintf("http://localhost%s%s/api/v3/traces/123", strings.Replace(httpLis.Addr().String(), "[::]", "", 1), basePath), nil)
req.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(req)
buf := bytes.Buffer{}
Expand Down
2 changes: 1 addition & 1 deletion idl
8 changes: 4 additions & 4 deletions proto-gen/api_v3/query_service.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ad17c5

Please sign in to comment.