GoogleCloudPlatform/cloud-sql-nodejs-connector

Connect should not error on ipType switching

jackwotherspoon opened this issue · 0 comments

Consecutive connect calls where the ipType switches between calls should not error out which it does currently. We store all the ip addresses of an instance in the connectionInfo so there is no need to error.

if (instance.ipType && instance.ipType !== ipType) {
throw new CloudSQLConnectorError({
message:
`getOptions called for instance ${instanceConnectionName} with ipType ${ipType}, ` +
`but was previously called with ipType ${instance.ipType}. ` +
'If you require both for your use case, please use a new connector object.',
code: 'EMISMATCHIPTYPE',
});