Skip to content
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

Pass router param inputs to identifiers #2056

Merged
merged 3 commits into from
Jul 13, 2018
Merged

Pass router param inputs to identifiers #2056

merged 3 commits into from
Jul 13, 2018

Conversation

adleong
Copy link
Member

@adleong adleong commented Jul 11, 2018

Stack params are passed to identifier plugins to configure them. However, only params from the router config are passed to the identifier. In particular, this means that the stats receiver is not available to the identifier because it is not a router config param.

Pass stack params as input to the router params. This allows the stats receiver to be passed into the router params.

Fixes #1963

Signed-off-by: Alex Leong alex@buoyant.io

Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong self-assigned this Jul 11, 2018
Copy link
Contributor

@dadjeibaah dadjeibaah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -113,7 +113,7 @@ class HttpConfigTest extends FunSuite with Awaits {
|- port: 5000
""".stripMargin
val config = parse(yaml)
val identifier = config.routerParams[Http.param.HttpIdentifier]
val identifier = config.routerParams(Stack.Params.empty)[Http.param.HttpIdentifier]
.id(Path.read("/svc"), () => Dtab.empty)
val req = Request(Method.Get, "/one/two/three")
assert(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a test that validates that we are receiving a StatsReceiver in an identifier to show that it propagates through initialization?

Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong merged commit d74ebd7 into master Jul 13, 2018
@adleong adleong deleted the alex/params branch July 13, 2018 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants