-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added optional dbName in header for tls #641
added optional dbName in header for tls #641
Conversation
server/src/milvus/milvus.service.ts
Outdated
@@ -55,6 +55,10 @@ export class MilvusService { | |||
if (process.env.SERVER_NAME) { | |||
clientConfig.tls.serverName = process.env.SERVER_NAME; | |||
} | |||
|
|||
if (process.env.DB_NAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this here. you can set the process.env.DATABASE
. it will be passed from the client.
But still, you need to pass the database to the MilvusClient.
like this:
const clientConfig: ClientConfig = {
address: milvusAddress,
token,
username,
password,
logLevel: process.env.ATTU_LOG_LEVEL || 'info',
database: database || this.DEFAULT_DATABASE,
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this here. you can set the
process.env.DATABASE
. it will be passed from the client.But still, you need to pass the database to the MilvusClient.
like this:
const clientConfig: ClientConfig = { address: milvusAddress, token, username, password, logLevel: process.env.ATTU_LOG_LEVEL || 'info', database: database || this.DEFAULT_DATABASE, };
hi @shanghaikid , didn't get this.
i am assigning this to clientConfig.database
inside if statement. i see in SDK that clientConfig has a optional field database. it is also working this way.
I did not understood your comment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
database
should be passed from the client to the server side.
The client will read process.env.DATABASE
.
Yes, you can setup new DB_NAME
env here, but it will be a conflict with process.env.DATABASE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, updated.
thanks @shanghaikid
In the case of a TLS-enabled environment, our Istio service needs a dbName in the header to route the request. In all our environments, we don't necessarily keep a "default" database, so we want to send something from the UI to it.
Without it, the Attu connection breaks on milvusClient.healthCheck().
With this code change it works fine.