Closed prakarp closed 4 years ago
https://gitlab.bertha.cloud/partitio/lab/micro-gateway/-/blob/atlas-patch/runtime/fieldmask.go There is a patch available that uses the 'generator' package and at least the build process completes.
The generated application runs, but it remains to be seen if there are semantic differences because of the descriptorpb package isn't used in the patch. Also the use of 'generator' package results in a warning as 'generator' package is supposed to be a private one, and not for public use. But you can move to the next step with the patch above until the proper fix is applied.
We either need to revert to an older release or update the code generated to conform to the new interface. To fix this you can revert to the older release, until the code is updated:
diff --git a/go.mod b/go.mod
index 46adf47..0c3ad71 100644
--- a/go.mod
+++ b/go.mod
@@ -6,7 +6,7 @@ require (
github.com/golang/protobuf v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
- github.com/grpc-ecosystem/grpc-gateway v1.14.6
+ github.com/grpc-ecosystem/grpc-gateway v1.9.6
github.com/infobloxopen/atlas-app-toolkit v0.21.1
It should compile:
go mod vendor
go build cmd/server/*.go
https://github.com/infobloxopen/atlas-cli/issues/60#issuecomment-644542690
Closing the issue.
This looks like a compatibility issue with the code that is generated by atlas toolkit and the github.com/grpc-ecosystem/grpc-gateway/runtime package.
There are two errors when running the command " go run cmd/server/*.go "
(Ubuntu 16.04)
runtime.CamelCaseFieldMask() this function does not exist vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go
runtime.FieldMaskFromRequestBody - this funciton requires an additional argument.
There are many instances of these sets of errors in pkg/pb/service.pb.gw.go (in the generated app)
How to reproduce
Expected Output
(Assuming that config.yaml has a GRPC port configured as 9099 because 9090 is used by systemd on Linux. This is from an app that has been "fixed" - see the comment below that indicates a workaround of using the 'generator' package, from bertha.cloud site).
Actual Output
Apply a patch (manually)
Patch is available from: https://gitlab.bertha.cloud/partitio/lab/micro-gateway/-/blob/atlas-patch/runtime/fieldmask.go
(Edit the file fieldmask.go.... I have a copy of the file fieldmask.go that has been edited and simply copy over to the generated app like below.
Run the App again
This time the app runs successfully.. the configuration values for the Postgres database are wrong and so the app exits.. That is not related to the issue.
Ubuntu 16.04