Validate sentinel-port only when TLS is disabled or non-TLS port != 0 (#46)

* Modify sentinel-port checks depending on TLS settings activation

Signed-off-by: Konstantin Davidenko <kdavidenko@alfabank.ru>

* Fix if condition

Signed-off-by: Miguel A. Cabrera Minagorri <mcabrera@vmware.com>

* Fix if condition

Signed-off-by: Miguel A. Cabrera Minagorri <mcabrera@vmware.com>

* Fix if condition

Signed-off-by: Miguel A. Cabrera Minagorri <mcabrera@vmware.com>

Co-authored-by: Konstantin Davidenko <kdavidenko@alfabank.ru>
Co-authored-by: Miguel Ángel Cabrera Miñagorri <mcabrera@vmware.com>
This commit is contained in:
Konstantin
2022-02-09 13:16:36 +03:00
committed by GitHub
parent beacd848eb
commit 681c5abef6
3 changed files with 9 additions and 3 deletions

View File

@@ -80,7 +80,9 @@ redis_validate() {
is_positive_int "$REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS" || print_validation_error "Invalid down-after-milliseconds value (only positive integers allowed)"
is_positive_int "$REDIS_SENTINEL_FAILOVER_TIMEOUT" || print_validation_error "Invalid failover-timeout value (only positive integers allowed)"
check_allowed_port REDIS_SENTINEL_PORT_NUMBER
if ! is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED" || [[ "$REDIS_SENTINEL_PORT_NUMBER" != "0" ]]; then
check_allowed_port REDIS_SENTINEL_PORT_NUMBER
fi
check_resolved_hostname "$REDIS_MASTER_HOST"
if is_boolean_yes "$REDIS_SENTINEL_TLS_ENABLED"; then