Add support for new endpoint key string 'gateway' (#4954)

This commit is contained in:
Gene Lee
2019-04-09 15:19:02 -07:00
committed by GitHub
parent ea8f885f05
commit b3be1d79cd
4 changed files with 16 additions and 5 deletions

View File

@@ -13,7 +13,8 @@ export const extensionConfigSectionName = 'mssql';
// DATA PROTOCOL VALUES ///////////////////////////////////////////////////////////
export const mssqlClusterProviderName = 'mssqlCluster';
export const hadoopKnoxEndpointName = 'Knox';
export const hadoopEndpointNameKnox = 'Knox';
export const hadoopEndpointNameGateway = 'gateway';
export const protocolVersion = '1.0';
export const hostPropName = 'host';
export const userPropName = 'user';

View File

@@ -79,7 +79,11 @@ async function createSqlClusterConnInfo(sqlConnInfo: azdata.IConnectionProfile |
let endpoints: IEndpoint[] = serverInfo.options[constants.clusterEndpointsProperty];
if (!endpoints || endpoints.length === 0) { return undefined; }
let index = endpoints.findIndex(ep => ep.serviceName === constants.hadoopKnoxEndpointName);
let index = endpoints.findIndex(ep => {
let serviceName: string = ep.serviceName.toLowerCase();
return serviceName === constants.hadoopEndpointNameKnox.toLowerCase() ||
serviceName === constants.hadoopEndpointNameGateway.toLowerCase();
});
if (index < 0) { return undefined; }
let credentials = await azdata.connection.getCredentials(connectionId);