-
Notifications
You must be signed in to change notification settings - Fork 560
cache: add support for xDS TTLs #359
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
Changes from all commits
d60ddf1
6a04f23
46e1521
4950ef7
7c7bd4b
8a3df30
46f7685
85188e4
d28f5f3
dc7554a
506f272
bd50781
ef8ef83
7ca85c3
62b78a4
83e352f
8aa5fc4
b9fe8c9
703d458
e428918
8c823a7
c3585ab
d899fe9
0bc2e6e
3d7535d
eb44d1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,13 +86,13 @@ func MarshalResource(resource types.Resource) (types.MarshaledResource, error) { | |
|
|
||
| // GetResourceReferences returns the names for dependent resources (EDS cluster | ||
| // names for CDS, RDS routes names for LDS). | ||
| func GetResourceReferences(resources map[string]types.Resource) map[string]bool { | ||
| func GetResourceReferences(resources map[string]types.ResourceWithTtl) map[string]bool { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there something we can do here so we don't need to change the param type to a concrete implementation? Maybe by adding a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah I like that, should simplify things quite a bit
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spent some time trying to get this to work, the problem is that by adding a function here regular proto messages no longer satisfy the interface, which means that we end up having to wrap the resources in a struct regardless. I tried composing a lmk if you have any ideas for how to get this working, otherwise the current approach seems like the simplest one (if verbose)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we change Resource to be a lightweight struct that embeds a proto? Might be a cleaner solution.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I gave this a go, the problem here is that it means that a regular proto no longer passes as a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you could do
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Omitting the field name works when there's only one field e.g. I would expose the a function to get the TTL but that means having to embed the TTL within the proto, which then forces the user to use the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll note that this adds a bunch of complexity around anything that cares about the actual resource, like consistency checks, as we need to handle potentially unwrapping the wrapper type to see the real resource.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok after much more playing around it seems like embedding |
||
| out := make(map[string]bool) | ||
| for _, res := range resources { | ||
| if res == nil { | ||
| if res.Resource == nil { | ||
| continue | ||
| } | ||
| switch v := res.(type) { | ||
| switch v := res.Resource.(type) { | ||
| case *endpoint.ClusterLoadAssignment: | ||
| // no dependencies | ||
| case *cluster.Cluster: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.