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 {
101
101
// New returns a new xDS Client configured with the provided config.
102
102
func New (config Config ) (* XDSClient , error ) {
103
103
switch {
104
- case config .Node .ID == "" :
105
- return nil , errors .New ("xdsclient: node ID is empty" )
106
104
case config .ResourceTypes == nil :
107
105
return nil , errors .New ("xdsclient: resource types map is nil" )
108
106
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) {
36
36
config Config
37
37
wantErr string
38
38
}{
39
- {
40
- name : "empty node ID" ,
41
- config : Config {},
42
- wantErr : "node ID is empty" ,
43
- },
44
39
{
45
40
name : "nil resource types" ,
46
41
config : Config {
@@ -75,6 +70,16 @@ func (s) TestXDSClient_New(t *testing.T) {
75
70
},
76
71
wantErr : "" ,
77
72
},
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
+ },
78
83
{
79
84
name : "success with authorities" ,
80
85
config : Config {
You can’t perform that action at this time.
0 commit comments