grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Improve the xDS bootstrap package

Open easwars opened this issue 1 year ago • 2 comments

We currently have a bunch of xDS bootstrap packages:

  • xds/bootstrap
    • This currently only contains code dealing with channel credentials functionality in the bootstrap file.
      • This should be moved to xds/bootstrap/credentials.
  • internal/xds/bootstrap
    • This currently has the bootstrap parsing code used by production code. The parsing functionality is also used minimally by test code.
    • All types defined here like Config, ServerConfig, Authority, ChannelCreds etc should support the following functionality:
      • A MarshalJSON method to output marshaled JSON bytes
      • A UnmarshalJSON method to read JSON and update the internals of the type
      • A Equal method to avoid implementing custom equality functions in tests
      • A String method to output human readable contents for debugging
    • This should be moved to xds/bootstrap
  • internal/testutils/xds/bootstrap
    • This has bootstrap parsing functionality used by test code
    • This should be removed and we should get the test code to be functionality from xds/bootstrap

easwars avatar May 24 '24 16:05 easwars

Based on offline discussions, we think it makes sense to keep the bootstrap functionality in internal/xds/bootstrap since it is being used from outside of the xDS tree. Also, putting it in xds/bootstrap will make the API public which is not desirable.

easwars avatar May 24 '24 19:05 easwars

A bunch of cleanup happened in https://github.com/grpc/grpc-go/pull/7299.

easwars avatar Jun 10 '24 22:06 easwars