File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
xds/internal/clients/xdsclient Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -101,8 +101,6 @@ type XDSClient struct {
101101// New returns a new xDS Client configured with the provided config.
102102func New (config Config ) (* XDSClient , error ) {
103103 switch {
104- case config .Node .ID == "" :
105- return nil , errors .New ("xdsclient: node ID is empty" )
106104 case config .ResourceTypes == nil :
107105 return nil , errors .New ("xdsclient: resource types map is nil" )
108106 case config .TransportBuilder == nil :
Original file line number Diff line number Diff line change @@ -36,11 +36,6 @@ func (s) TestXDSClient_New(t *testing.T) {
3636 config Config
3737 wantErr string
3838 }{
39- {
40- name : "empty node ID" ,
41- config : Config {},
42- wantErr : "node ID is empty" ,
43- },
4439 {
4540 name : "nil resource types" ,
4641 config : Config {
@@ -75,6 +70,16 @@ func (s) TestXDSClient_New(t *testing.T) {
7570 },
7671 wantErr : "" ,
7772 },
73+ {
74+ name : "success with servers and empty nodeID" ,
75+ config : Config {
76+ Node : clients.Node {ID : "" },
77+ ResourceTypes : map [string ]ResourceType {xdsresource .V3ListenerURL : listenerType },
78+ TransportBuilder : grpctransport .NewBuilder (configs ),
79+ Servers : []ServerConfig {{ServerIdentifier : clients.ServerIdentifier {ServerURI : "dummy-server" }}},
80+ },
81+ wantErr : "" ,
82+ },
7883 {
7984 name : "success with authorities" ,
8085 config : Config {
You can’t perform that action at this time.
0 commit comments