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

Add Redis Sentinel config as environment vars #1134

Merged

Conversation

NeodymiumFerBore
Copy link
Contributor

@NeodymiumFerBore NeodymiumFerBore commented Jan 16, 2024

Related Issue: None

New Behavior

Allow to configure Redis Sentinel via environment variables. This change does not break existing configurations.

Contrast to Current Behavior

Cannot configure Redis Sentinels without using extra config mechanism.

Discussion: Benefits and Drawbacks

If environment variable REDIS_SENTINELS or REDIS_CACHE_SENTINELS are not defined, the resulting configuration will be an empty list []. Upstream netbox also defaults it to [] (redis tasks, redis cache).

I chose to not default REDIS["cache"]["SENTINELS"] to redis tasks Sentinels (as it is done for HOST and PORT for example), because SENTINELS always takes precedence over direct connection. And one may want to use Sentinels for a redis instance but not the other one.

Benefits:

  • More configuration via environment variables, without extra configuration
  • Does not break already existing configurations

Changes to the Wiki

I don't think any

Proposed Release Note Entry

Allow to configure Redis Sentinels via environment variables

Double Check

  • I have read the comments and followed the PR template.
  • I have explained my PR according to the information in the comments.
  • My PR targets the develop branch.

@NeodymiumFerBore
Copy link
Contributor Author

Just realized PR #1130 was already opened for this topic, but as draft. Since this one has less code duplication, I keep it open.

@tobiasge tobiasge merged commit b8a7ffd into netbox-community:develop Jan 20, 2024
9 checks passed
@tobiasge tobiasge mentioned this pull request Jan 20, 2024
@tobiasge tobiasge mentioned this pull request May 6, 2024
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.

2 participants