-
Notifications
You must be signed in to change notification settings - Fork 661
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
ErrMapIncompatible should contain additional information #1034
Comments
@ti-mo hi I am new to this org and want to contribute to this issue can you please guide me through it |
@swastik959 There's a short document at https://github.com/cilium/ebpf/blob/master/CONTRIBUTING.md. Do you have any specific questions? |
Hello @ti-mo, I would like to work on this if no one is actively working on this. |
@sharathsivakumar Sure thing! Assigned the issue to you. |
Thanks! |
Closing this for now, since it's actually quite tricky to implement. This should happen if / when we use the info from the cilium side. |
In cilium/cilium#22693, Cilium will start relying exclusively on the library to tell it when a map is incompatible with an existing pinned map, but right now
ErrMapIncompatible
is a little vague. Callers need to open the old map explicitly, inspect its info, and work out the differences with the MapSpec.Updated to echo #1093 (comment).
I think there are 2 issues with the existing code:
expected type %v, got %v
). We should settle on language that clarifies which side is the existing Map and which is the incoming Spec.As a bonus, it would be nice if this would return a new
ebpf.IncompatibleMapError{OldType, NewType ebpf.MapType, ...}
that.Unwrap()
s toErrMapIncompatible
so it can be used like:This would be really useful to trigger up/downgrade logic.
Also,
.Error()
should only return a diff of the map's properties, not a dump of all old/new properties. That's just something I hacked up in Cilium to move ahead with the changes there.The text was updated successfully, but these errors were encountered: