-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
xds: remove support for v2 Transport API #6013
Conversation
NodeProto proto.Message | ||
// NodeProto contains the Node proto to be used in xDS requests. This will be | ||
// of type *v3corepb.Node. | ||
NodeProto *v3corepb.Node |
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.
We should move NodeProto
out of ServerConfig
and into Config
.
NodeProto
was part of ServerConfig
(even though it contains information about the local node and not the remote management server) because we had to support servers which spoke different transport protocols (v2/v3). Hence we used to marshal the node information in the appropriate version of the NodeProto
corresponding to the transport protocol version spoken by the server.
Now that we are going to use v3 for all servers, there is no need to store node information per server. I don't know off the top of my head if this change will be more involved. So, I'm OK if you want to make that change as a follow up PR. If you plan on doing that, please add a TODO here.
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.
Sure. Actually I think it makes sense to include that in this PR. Adding it in the update
case version.TransportV3: | ||
c.XDSServer.NodeProto = v3 | ||
} | ||
c.XDSServer.NodeProto = v3 |
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.
We could completely get rid of this method (or simplify it greatly) if we move the NodeProto
out of ServerConfig
into Config
.
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.
Sounds good 👍
// TestNewConfigV2ProtoSuccess exercises the functionality in NewConfig with | ||
// different bootstrap file contents. It overrides the fileReadFunc by returning | ||
// bootstrap file contents defined in this test, instead of reading from a file. | ||
func TestNewConfigV2ProtoSuccess(t *testing.T) { |
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.
Same here. We need to ensure that we don't lose any test coverage.
xds/internal/xdsclient/singleton.go
Outdated
if node, ok := config.XDSServer.NodeProto.(interface{ GetId() string }); ok { | ||
nodeID = node.GetId() | ||
} | ||
nodeID := config.XDSServer.NodeProto.GetId() |
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.
Nit: inline this in the log statement.
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.
done
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.
Could you also please grep the whole codebase for something like "v2*pb" to ensure that we are not using any v2 protos anywhere. If you do find some, you can also fix them in a follow up PR, based on how many occurrences you see.
@@ -292,6 +261,9 @@ type Config struct { | |||
// In any of those cases, it is an error if the specified authority is | |||
// not present in this map. | |||
Authorities map[string]*Authority | |||
// NodeProto contains the Node proto to be used in xDS requests. This will be |
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.
Do we need this comment This will be of type *v3corepb.Node.
? Given that the field is defined to be of that type now.
@@ -143,6 +143,9 @@ type Options struct { | |||
Backoff func(retries int) time.Duration | |||
// Logger does logging with a prefix. | |||
Logger *grpclog.PrefixLogger | |||
// NodeProto contains the Node proto to be used in xDS requests. This will be | |||
// of type *v3corepb.Node. |
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.
Same comment about the comment here.
Issue states that this is a feature and not a behavior change.. Also need to close and re-open to run new tests in github actions |
We need to remove support for xDS transport API v2 in gRPC. This diff does it.
Fixes #5718
RELEASE NOTES: