Closed Joel-Cripps closed 2 years ago
I wasn't able to reproduce when running your command and just printing out the metadata:
129 ctx = credentials.AttachToContext(ctx)
130
131 md, _ := metadata.FromOutgoingContext(ctx)
132 fmt.Println(md)
I'm failing to see what might be causing AttachToContext
to be called twice on the same ctx
object -- is your code being run in parallel?
Can you try if https://github.com/google/gnxi/pull/273 fixes it?
assuming fixed in #273
It looks like the newer gnxi/gnmi_get commands are duplicating username and passwords.
Older client: go run gnmi_get.go -target_addr localhost:6032 -username admin -password 123456! -v 10 -xpath "/local-routes" --target_name localhost -insecure -time_out 120s
New client:
Looks like the commit is probably : https://github.com/google/gnxi/commit/ee650d60abdcfb4ad1759b311ad0450f332e1b05
Changing the following line to just
return metadata.AppendToOutgoingContext(ctx)
fixes the issue. https://github.com/google/gnxi/blob/5f44df13a119bcc3748fa15b216c38bb9072a1d8/utils/credentials/credentials.go#L168I'm not sure if there is any reason to be sending multiple username/passwords, or have username and passwords as lists instead of a string.