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

For gnmi_ext.proto, run protoc with github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto (this is for reflections). #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hyun-arista
Copy link

The Problem

gNMI server reflections is basically facing the same issue as mentioned in fullstorydev/grpcurl#22. When the gnmi_ext.proto file gets compiled with path proto/gnmi_ext/gnmi_ext.proto, gNMI server reflection breaks with the following error:

Failed to resolve symbol "gnmi.gNMI": file "proto/gnmi/gnmi.proto" included an unresolvable reference to ".gnmi_ext.Extension"

The Proposal

If gnmi_ext.proto gets compiled with github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto, gNMI server reflections work. So, I modified the gnmi_ext.proto portion in compile_protos.sh to (only the go binding):

protoc -I=$proto_imports_go --go_out=${GOPATH}/src --go_opt=paths=source_relative github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto

I assumed that the github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto path is under ${GOPATH}/src. $proto_imports_go includes ${GOPATH}/src so the go binding should be generated under ${GOPATH}/src/github.com/openconfig/gnmi/proto/gnmi_ext/.

Manual Testing

In my case, I have gnmi_ext.proto under /vendor/github.com/openconfig/gnmi/proto/gnmi_ext/. When I did

protoc -I=vendor --go_out=vendor --go_opt=paths=source_relative github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto

The generated go binding's source is identified as github.com/openconfig/gnmi/proto/gnmi_ext/gnmi_ext.proto and the gNMI server reflections work.

A Request

This is a message to the reviewer of this pull request. Please modify the python binding portion of compile_protos.sh if necessary. Also, please compile_protos.sh to modify gnmi_ext.pb.go under ${GOPATH}/src/github.com/openconfig/gnmi/proto/gnmi_ext/. Thank you.

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

Successfully merging this pull request may close these issues.

1 participant