Skip to content

implement nodeAddressMap for sentinel - #3145

Merged
nkaradzhov merged 3 commits into
redis:masterfrom
elimelt:elimelt/3144/nodeAddressMap
Jan 12, 2026
Merged

nkaradzhov merged 3 commits into
redis:masterfrom
elimelt:elimelt/3144/nodeAddressMap

Conversation

@elimelt

@elimelt elimelt commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Description

Describe your pull request here

Adds support for nodeAddressMap to sentinel client options, equivalent to cluster's nodeAddressMap feature.

I'd like to be able to use/test Sentinel from outside a k8s cluster, but returned addresses aren't resolvable to the client

Closes #3144


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@jit-ci

jit-ci Bot commented Dec 5, 2025

Copy link
Copy Markdown

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@elimelt
elimelt marked this pull request as ready for review December 8, 2025 21:09
@PavelPashov

Copy link
Copy Markdown
Contributor

Thank you for the PR. I’ve added it to my review list.

@elimelt

elimelt commented Dec 29, 2025

Copy link
Copy Markdown
Contributor Author

@PavelPashov any way we could try and re-run the tests for 8.0.2 to see if this is a flake?

@nkaradzhov nkaradzhov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@elimelt thanks for this, it looks good in general. I just left couple of nits

Comment thread packages/client/lib/sentinel/index.ts Outdated
Comment thread packages/client/lib/sentinel/index.ts Outdated
Address PR review comments:
- Remove duplicate #getNodeAddress methods from RedisSentinelInternal and RedisSentinelFactory
- Add getMappedNode utility function in utils.ts that takes host, port, and nodeAddressMap
- Update all callsites to use the new utility function

This eliminates code duplication and makes the address mapping logic reusable.
@elimelt

elimelt commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@nkaradzhov fixed!

@elimelt
elimelt requested a review from nkaradzhov January 10, 2026 00:16
@nkaradzhov
nkaradzhov merged commit 1d4ca9d into redis:master Jan 12, 2026
17 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.

Redis Sentinel ip address/hostname mapping config

3 participants