Skip to content

Commit 1ba675b

Browse files
committed
fix(cynosdb): serverless db no readlist
1 parent 53373ee commit 1ba675b

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

__tests__/cynosdb.test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ describe('Cynosdb', () => {
9898
connection: {
9999
ip: expect.any(String),
100100
port: 3306,
101-
readList: expect.any(Array),
102101
},
103102
});
104103

@@ -123,7 +122,6 @@ describe('Cynosdb', () => {
123122
connection: {
124123
ip: expect.any(String),
125124
port: 3306,
126-
readList: expect.any(Array),
127125
},
128126
publicConnection: {
129127
domain: expect.any(String),
@@ -150,7 +148,6 @@ describe('Cynosdb', () => {
150148
connection: {
151149
ip: expect.any(String),
152150
port: 3306,
153-
readList: expect.any(Array),
154151
},
155152
});
156153
inputs.clusterId = undefined;

src/modules/cynosdb/utils.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ function isSupportZone(zone, isServerless = false) {
4242
}
4343

4444
function formatConnectOutput(detail) {
45-
const RoAddr = detail.RoAddr || [];
46-
const readList = RoAddr.map((item) => {
47-
return {
48-
ip: item.IP,
49-
port: item.Port,
50-
};
51-
});
5245
const info = {
5346
ip: detail.Vip,
5447
port: detail.Vport,
55-
readList: readList,
5648
};
49+
if (detail.DbMode !== 'SERVERLESS') {
50+
const RoAddr = detail.RoAddr || [];
51+
info.readList = RoAddr.map((item) => {
52+
return {
53+
ip: item.IP,
54+
port: item.Port,
55+
};
56+
});
57+
}
5758

5859
return info;
5960
}

0 commit comments

Comments
 (0)