grpc-go
grpc-go copied to clipboard
Improve the xDS bootstrap package
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.
- This should be moved to
- This currently only contains code dealing with channel credentials functionality in the bootstrap file.
-
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,ChannelCredsetc should support the following functionality:- A
MarshalJSONmethod to output marshaled JSON bytes - A
UnmarshalJSONmethod to read JSON and update the internals of the type - A
Equalmethod to avoid implementing custom equality functions in tests - A
Stringmethod to output human readable contents for debugging
- A
- 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
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.
A bunch of cleanup happened in https://github.com/grpc/grpc-go/pull/7299.