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

Snapshot with empty version #915

Open
pravinpushkar opened this issue Apr 7, 2024 · 2 comments
Open

Snapshot with empty version #915

pravinpushkar opened this issue Apr 7, 2024 · 2 comments

Comments

@pravinpushkar
Copy link

I have a query below.

I pass a valid resource and a version (lets say 1) to below method -

snapshot, err = cachev3.NewSnapshot(version, resources)

In the next update, I am expecting to pass nil/empty resource and version 2 to above call.
I was hoping that it would generate a snapshot with updated version and empty resources, but I get something like this -

&{[{ map[]} { map[]}} 

# instead of 
&{[{ version: 2 map[]} { version:2 map[]}}

Because of version not present in new snapshot the RespondDelta gives empty version like this and my envoy config does not get updated in time.

open delta watch ID:2 for type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.Secret Resources:map[] from nodeID: "XXX",  version ""

Is there way to handle this situation or is this behaviour expected because of any reason ?

Copy link

github-actions bot commented May 7, 2024

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 7, 2024
@valerian-roche
Copy link
Contributor

Hey,
From the current implementation at https://github.com/envoyproxy/go-control-plane/blob/main/pkg/cache/v3/snapshot.go#L51, you need to provide the types you are explicitly setting to "empty". The current snapshot cache code work with a logic per type (even if the current snapshot API "constructors" don't let you set distinct versions). This could be used for instance to avoid sending updates for unchanged types in sotw version if nothing has changed for a given type

@github-actions github-actions bot removed the stale label May 8, 2024
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

No branches or pull requests

2 participants