-
Notifications
You must be signed in to change notification settings - Fork 319
Fix: wrong key used to access log-cache root endpoint. Fix cloudfoundry#1251 #1252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -24,6 +24,7 @@ | |||
import org.cloudfoundry.logcache.v1.ReadRequest; | |||
import org.cloudfoundry.logcache.v1.ReadResponse; | |||
import org.cloudfoundry.reactor.ConnectionContext; | |||
import org.cloudfoundry.reactor.RootProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import, please remove
please rebase on main |
e35de47
to
b2435fa
Compare
b2435fa
to
6ec4124
Compare
import reactor.test.StepVerifier; | ||
|
||
class ReactorLogCacheClientTest extends AbstractLogCacheApiTest { | ||
private static final String API_ROOT = "http://api.my.rapid.server.com"; | ||
private static final String LOGCACHE = "http://log-cache.my.rlog-cached.server.com"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] is having api
TWICE in the name intended, so that API.my.rAPId
becomes LOG-CACHE.my.rLOG-CACHEd
?
It took me a minute to figure it out.
"log_cache": { | ||
"href": "https://cache-for-logging.cf.lod-cfcli3.cfrt-sof.sapcloud.io" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[suggestion] Be consistent with the other endpoints, and use the run.pivotal.io
domain .
|
||
private final ReactorLogCacheEndpoints logCacheEndpoints = | ||
new ReactorLogCacheEndpoints( | ||
CONNECTION_CONTEXT, this.root, TOKEN_PROVIDER, Collections.emptyMap()); | ||
|
||
@Test | ||
void getRootFromFallback() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] You can drop the exception here.
Fix #1251.
The key to access the log-cache URL hay a typo.
Add one testcase to the normal access with the key.
Add one testcase for the fallback if the root endpoint does not provide the value. This test shows that the letters "api" in the remaining URL are also replaced, leading to invalid results.