-
Notifications
You must be signed in to change notification settings - Fork 327
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
chore(*) separate proxy template resolvers #2394
Conversation
Breaking the dependency between the simple proxy template resolver and the default fallback lets us specify the fallback as a default proxy template resolver. This in turn, makes it possible for plugins to wrap the default resolver so that this can be extended. Moving the default ProxyTemplate resources out of pkg/xds/template breaks a circular dependency between this package and xds/generator. Signed-off-by: James Peach <james.peach@konghq.com>
Codecov Report
@@ Coverage Diff @@
## master #2394 +/- ##
==========================================
+ Coverage 52.35% 52.53% +0.18%
==========================================
Files 875 877 +2
Lines 47816 47854 +38
==========================================
+ Hits 25033 25142 +109
+ Misses 20747 20664 -83
- Partials 2036 2048 +12
Continue to review full report at Codecov.
|
But if the plugin overrides only var DefaultTemplateResolver template.ProxyTemplateResolver = template.SequentialResolver(
&template.SimpleProxyTemplateResolver{
ReadOnlyResourceManager: rt.ReadOnlyResourceManager(),
},
&template.StaticProxyTemplateResolver{
Template: &mesh_proto.ProxyTemplate{
Conf: &mesh_proto.ProxyTemplate_Conf{
Imports: []string{mesh_core.ProfileDefaultProxy},
},
},
},
) and func DefaultReconciler(rt core_runtime.Runtime, xdsContext v3.XdsContext) xds_sync.SnapshotReconciler {
return &reconciler{
&templateSnapshotGenerator{
ResourceSetHooks: rt.XDSHooks().ResourceSetHooks(),
ProxyTemplateResolver: template.DefaultTemplateResolver,
},
&simpleSnapshotCacher{xdsContext.Hasher(), xdsContext.Cache()},
}
} WDYT? |
|
Breaking the dependency between the simple proxy template resolver and the default fallback lets us specify the fallback as a default proxy template resolver. This in turn, makes it possible for plugins to wrap the default resolver so that this can be extended. Moving the default ProxyTemplate resources out of pkg/xds/template breaks a circular dependency between this package and xds/generator. Signed-off-by: James Peach <james.peach@konghq.com> (cherry picked from commit 6b6f3c1)
Breaking the dependency between the simple proxy template resolver and the default fallback lets us specify the fallback as a default proxy template resolver. This in turn, makes it possible for plugins to wrap the default resolver so that this can be extended. Moving the default ProxyTemplate resources out of pkg/xds/template breaks a circular dependency between this package and xds/generator. Signed-off-by: James Peach <james.peach@konghq.com> (cherry picked from commit 6b6f3c1) Co-authored-by: James Peach <james.peach@konghq.com>
Summary
Breaking the dependency between the simple proxy template resolver and
the default fallback lets us specify the fallback as a default proxy
template resolver. This in turn, makes it possible for plugins to wrap
the default resolver so that this can be extended.
Moving the default ProxyTemplate resources out of pkg/xds/template
breaks a circular dependency between this package and xds/generator.
Full changelog
N/A
Issues resolved
N/A
Documentation
N/A
Testing
Backwards compatibility
backport-to-stable
label if the code is backwards compatible. Otherwise, list breaking changes.