Loki: Handle data source configs with path in the url (#50971)
* loki: fixed param-name * loki: handle datasource configs with path in the url * lint fix
This commit is contained in:
@@ -33,9 +33,13 @@ func (mockedRT *mockedRoundTripper) RoundTrip(req *http.Request) (*http.Response
|
||||
}
|
||||
|
||||
func makeMockedAPI(statusCode int, contentType string, responseBytes []byte, requestCallback mockRequestCallback) *LokiAPI {
|
||||
return makeMockedAPIWithUrl("http://localhost:9999", statusCode, contentType, responseBytes, requestCallback)
|
||||
}
|
||||
|
||||
func makeMockedAPIWithUrl(url string, statusCode int, contentType string, responseBytes []byte, requestCallback mockRequestCallback) *LokiAPI {
|
||||
client := http.Client{
|
||||
Transport: &mockedRoundTripper{statusCode: statusCode, contentType: contentType, responseBytes: responseBytes, requestCallback: requestCallback},
|
||||
}
|
||||
|
||||
return newLokiAPI(&client, "http://localhost:9999", log.New("test"), nil)
|
||||
return newLokiAPI(&client, url, log.New("test"), nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user