fix: unexpected password for root user (#41818)

issue: #41816
pr: #41817
pr #37983 introduced an issue, if doesn't specified
`defaultRootPassword` in milvus.yaml, then `"Milvus"` will be used as
default password for root user, instead of `Milvus`.

This PR fix the unexpected password for root, and add comment for case
which use large numeric password requires double quotes.

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2025-05-14 19:40:22 +08:00 committed by GitHub
parent 813bcb14a7
commit aed074d83e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -851,7 +851,9 @@ common:
# The superusers will ignore some system check processes,
# like the old password verification when updating the credential
superUsers:
defaultRootPassword: "Milvus" # default password for root user. The maximum length is 72 characters, and double quotes are required.
# default password for root user. The maximum length is 72 characters.
# Large numeric passwords require double quotes to avoid yaml parsing precision issues.
defaultRootPassword: Milvus
rootShouldBindRole: false # Whether the root user should bind a role when the authorization is enabled.
enablePublicPrivilege: true # Whether to enable public privilege
rbac:

View File

@ -673,10 +673,11 @@ like the old password verification when updating the credential`,
p.SuperUsers.Init(base.mgr)
p.DefaultRootPassword = ParamItem{
Key: "common.security.defaultRootPassword",
Version: "2.4.7",
Doc: "default password for root user. The maximum length is 72 characters, and double quotes are required.",
DefaultValue: "\"Milvus\"",
Key: "common.security.defaultRootPassword",
Version: "2.4.7",
Doc: `default password for root user. The maximum length is 72 characters.
Large numeric passwords require double quotes to avoid yaml parsing precision issues.`,
DefaultValue: "Milvus",
Export: true,
}
p.DefaultRootPassword.Init(base.mgr)