-
Notifications
You must be signed in to change notification settings - Fork 4.5k
xds: cleanup bootstrap processing functionality #7299
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good to me modulo a few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks goood to me 👍
98c3bdd
to
f3a5e3f
Compare
This PR cleans up how to process the bootstrap configuration. This also brings up in line with other languages in the following ways:
Node
proto to unmarshal bootstrap config'snode
field. Instead only read the supported fields. This is done by defining a struct with only the supported fields, and appropriate json struct tags.client_features
field from the bootstrap configuration. This is a field which should be completely controlled by the client implementation.Summary of changes:
internal/xds/bootstrap
package now exports the following types:ChannelCreds
: corresponds to thechannel_credentials
field in the bootstrap configAuthority
: corresponds to theauthority
field in the bootstrap configjson.Marshal
andjson.Unmarshal
;Equal
method to ensure that tests can usecmp.Diff
orcmp.Equal
without any custom cmp opts.ServerConfig
: corresponds to the message type within thexds_servers
field in the bootstrap configConfig
: the complete bootstrap configurationMarshalJSON
andUnmarshalJSON
methods;Equal
method for use withcmp.Diff
andcmp.Equal
.serverConfigJSON
andconfigJSON
) is also defined with exported fields and json struct tags to make it easy to marshal and unamrshal to JSON, instead of the old way, where we marshal tomap[string]json.RawMessage
and traverse the map, and individually marshal each of the fields.xds_v3
server feature. We do not support it any more. See here for when support was removed.passthrough
scheme to dial the xDS management server from tests.grpc.NewClient
which defaults to schemedns
, and how some tests override the actualdns
resolver with a mock one.With this change, tests cannot create a
ServerConfig
orConfig
struct using literal struct initializations. We have helpers to constructServerConfig
for tests, and we can createConfig
from JSON for tests. In a follow-up PR, I will move code out ofinternal/testutils/xds/bootstrap
which contains code to createConfig
for tests using options, and move it into the mainbootstrap
package. This change will simplify dependencies for tests, and will also help with eventually moving everything out ofxds/internal
tointernal/xds
.#a71-xds-fallback
RELEASE NOTES: none