-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[redis-cli][multiasic]redis-cli supports namespace #8243
Conversation
The current redis-cli has been hardcoded only to access to the host database. MThis change modifies the redis-cli to identify the namespace and access to its database
@lguohan Could you please help to review this change or assign the the right person to review it? |
@arlakshm - FYI |
|
This PR could be closed in favor of using sonic-db-cli |
@arlakshm - redis-cli is still in use in a lot of tests in sonic-mgmt. Is there a plan to modify all tests in sonic-mgmt to use sonic-db-cli? |
Hi @sanmalho-git , sonic-mgmt has function run_redis_cli_cmd to run the redis-cli on Asic or device. I think that should help. |
/usr/bin/redis-cli in the host and in the netns is hard-coded to use the global 'database'.
So, regardless of whether I add 'sudo ip netns exec' to the redis-cli command or not, it still goes to the global 'database'. As an example on a multi-asic box, keys PORT* in CONFIG_DB at the host level are:
Doing the above command in asic0 namespace gives the same result:
But if we use 'docker exec database0' we get the correct keys:
So, in sonic-mgmt, should run_redis_cli_cmd should do 'docker exec' instead of 'sudo ip netns exec'? |
The current redis-cli has been hardcoded only to access to the host database. MThis change modifies the redis-cli to identify the namespace and access to its database