-
Notifications
You must be signed in to change notification settings - Fork 229
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
MakeVariant
cannot properly evaluate a(st)
#328
Comments
MakVariant
cannot properly evaluate a(st)MakeVariant
cannot properly evaluate a(st)
@kolyshkin FYI, any help here either with what I am doing wrong or if I can make a PR to fix it would be appreciated. |
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves godbus#328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves godbus#328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
Just for my understanding: the issue here is just that the |
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves godbus#328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
I am using |
But from looking at containers/common#1082, I can't see why this would cause any issues with what you're trying to achieve. From what I can see, in the end you're just calling I'm just trying to figure out where the code lives (if any) that depends on the exact format of the string, because as mentioned, that would still be a Bad Idea (tm). |
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves godbus#328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves #328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves #328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves #328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
currently, structs are not parsed properly since `format()` has no handling for the reflect type add a switch case to handle structs and encode some sane defaults if given an empty one resolves #328 Signed-off-by: Charlie Doern <cdoern@redhat.com>
in order to utilize the systemd
BlockIOReadBandwidth
cgroup entity, I need to be able to parse and pass an array of structs that each contain a string and a uint64a(st)
. godbus is able to process the type viaMakeVariant
but theformat()
function invariant.go
returns["INVALID"]
when given an a(st) type.Am i doing something wrong here passing an array of structs or is there a gap in the parsing?
for example: giving a map of strings (a singular "BlockIOReadBandwidth") to structs
map[string][]BlkioBpsThrottle
that have the following format:and using the following loop to parse a map of length 1 with the device
8:16
and the throttle2097152
:results in:
[{8:16 2097152}] a(st) [{8:16 2097152}] ["INVALID"]
the
.String()
function callsformat()
which has no handling for eithera
or(..)
. I have also noticed thatMakeVariant
seems to recursively callgetSignature
ona(st)
even further confusing the output.a(st) is a valid type according to: https://man7.org/linux/man-pages/man5/org.freedesktop.systemd1.5.html and looking at: https://dbus.freedesktop.org/doc/dbus-specification.html#type-system can be interpreted as an array of structs that contains a string and an int.
Not sure if I hit a new use case or if my interpretation here is incorrect.
The text was updated successfully, but these errors were encountered: