Skip to content
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

feat: Hide InitAddress when connecting to a redis cluster using NewClient() #687

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

unknowntpo
Copy link
Contributor

@unknowntpo unknowntpo commented Dec 7, 2024

Resolves #635

What's changed:

In (c *clusterClient) _refresh(), when values in ClientOption.InitAddress is not in the return value of getClusterSlots, it should be hidden.

@unknowntpo unknowntpo marked this pull request as ready for review December 7, 2024 13:57
@unknowntpo unknowntpo changed the title Feat: Hide InitAddress when connecting to a redis cluster using NewClient() feat: Hide InitAddress when connecting to a redis cluster using NewClient() Dec 7, 2024
cluster.go Outdated
nodes = append(nodes, addr)
for addr, role := range c.conns {
// only display non-hidden connrole
if !role.hidden {
Copy link
Collaborator

@rueian rueian Dec 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to change this nodes() method. It is a private method for other testing purposes.

We should test this new hidden behaivor explicitly in a new test case for the public Node() method.

@rueian rueian merged commit 5c29d32 into redis:main Dec 9, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide InitAddress when connecting to a valkey cluster using NewClient()
2 participants