Skip to content

Commit bbb363c

Browse files
committed
wip
1 parent 3f8a1b5 commit bbb363c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/common/atlas/cluster.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ export function formatCluster(cluster: ClusterDescription20240805): Cluster {
7171

7272
const instanceSize = regionConfigs[0]?.instanceSize ?? "UNKNOWN";
7373
const clusterInstanceType = instanceSize === "M0" ? "FREE" : "DEDICATED";
74-
const connectionString = cluster.connectionStrings?.standardSrv || cluster.connectionStrings?.standard;
7574

7675
return {
7776
name: cluster.name,
7877
instanceType: clusterInstanceType,
7978
instanceSize: clusterInstanceType === "DEDICATED" ? instanceSize : undefined,
8079
state: cluster.stateName,
8180
mongoDBVersion: cluster.mongoDBVersion,
82-
connectionString,
8381
connectionStrings: cluster.connectionStrings,
8482
processIds: extractProcessIds(cluster.connectionStrings?.standard ?? ""),
8583
};
@@ -89,6 +87,9 @@ export function getConnectionString(
8987
connectionStrings: ClusterConnectionStrings,
9088
connectionType: "standard" | "private"
9189
): string | undefined {
90+
if (connectionStrings === undefined) {
91+
return undefined;
92+
}
9293
if (connectionType === "standard") {
9394
return connectionStrings.standardSrv || connectionStrings.standard;
9495
}

src/tools/atlas/connect/connectCluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class ConnectClusterTool extends AtlasToolBase {
119119
expiryDate,
120120
};
121121

122-
const cn = new URL(cluster.connectionString);
122+
const cn = new URL(connectionString);
123123
cn.username = username;
124124
cn.password = password;
125125
cn.searchParams.set("authSource", "admin");

0 commit comments

Comments
 (0)