Skip to content

Commit

Permalink
fix(connection):adapter result has been overwritten. (#340)
Browse files Browse the repository at this point in the history
* Fix the issue of the Adapter result being overwritten.

* fix get sys tenant password
  • Loading branch information
guowl3 authored Sep 15, 2023
1 parent 3dd5b59 commit a892684
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public <T extends CloudConnectionConfig> T adaptConfig(T connectionConfig) {
}
if (cloudMetadataClient.needsSysTenantUser()) {
// 需要使用 sys 租户账密
OBDatabaseUser sysTenantUser = cloudMetadataClient.getSysTenantUser(clusterName);
OBDatabaseUser sysTenantUser = cloudMetadataClient.getSysTenantUser(connectionConfig.getClusterName());
connectionConfig.setSysTenantUsername(sysTenantUser.getUserName());
connectionConfig.setSysTenantPassword(sysTenantUser.getPassword());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,11 @@ public ConnectionConfig getForConnectionSkipPermissionCheck(@NotNull Long id) {
connection.setQueryTimeoutSeconds(minQueryTimeoutSeconds);
log.debug("queryTimeoutSeconds less than minQueryTimeoutSeconds, use {} instead", minQueryTimeoutSeconds);
}
connectionEncryption.decryptPasswords(connection);
// Adapter should be called after decrypting passwords.
environmentAdapter.adaptConfig(connection);
connectionSSLAdaptor.adapt(connection);
return connectionEncryption.decryptPasswords(connection);
return connection;
}

@Transactional(rollbackFor = Exception.class)
Expand Down

0 comments on commit a892684

Please sign in to comment.