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

auto-generated code with gateway/v2 break atlas applications #105

Open
seizadi opened this issue Sep 9, 2021 · 0 comments
Open

auto-generated code with gateway/v2 break atlas applications #105

seizadi opened this issue Sep 9, 2021 · 0 comments

Comments

@seizadi
Copy link

seizadi commented Sep 9, 2021

Looks like we have switched tooling to gateway/v2, my ‘make protobuf’ broke as infoblox/atlas-gentool:latest emits gateway/v2 stubs. I tried to covert my app to use the new app-toolkit, it compiles but takes a run time error:

proto: extension number 1042 is already registered on message google.protobuf.FileOptions

See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict

I created a new atlas app using:

atlas init-app -gateway -pubsub -health -helm -name cost-insights-backend -registry soheileizadi -kind

I built and ran this app and it gave me the same panic message.

I debugged this problem, Proto ExtensionType being registered that throws error is:

grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger

I removed the following import from my ‘service.pb.go’ auto-generated code:

_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"

The init of the library was registering extension that was causing the problem,
with that change I can run my application now. I am logging this with the gentool but might require additional
supporting atlas app toolkit.

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

1 participant