-
Notifications
You must be signed in to change notification settings - Fork 44
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
chore: pick redis sentinel acl & custom secret password & redis cluster optimize to main #1389
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e44e8b2
pick redis sentinel acl & custom secret & redis cluster optimize to main
Y-Rookie 6551b76
pick redis sentinel acl & custom secret & redis cluster optimize to main
Y-Rookie 7731267
pick redis sentinel acl & custom secret & redis cluster optimize to main
Y-Rookie e4b459d
pick redis sentinel acl & custom secret & redis cluster optimize to main
Y-Rookie 09b9919
pick redis sentinel acl & custom secret & redis cluster optimize to main
Y-Rookie a14f059
fix script ut
Y-Rookie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
addons/redis/redis-cluster-scripts/redis-cluster-replica-pre-stop.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck disable=SC2034 | ||
ut_mode="false" | ||
test || __() { | ||
# when running in non-unit test mode, set the options "set -e". | ||
set -ex; | ||
} | ||
|
||
load_common_library() { | ||
# the common.sh scripts is mounted to the same path which is defined in the cmpd.spec.scripts | ||
common_library_file="/scripts/common.sh" | ||
# shellcheck disable=SC1090 | ||
source "${common_library_file}" | ||
} | ||
|
||
acl_save_before_stop() { | ||
if ! is_empty "$REDIS_DEFAULT_PASSWORD"; then | ||
acl_save_command="redis-cli -h localhost -p $SERVICE_PORT -a $REDIS_DEFAULT_PASSWORD acl save" | ||
logging_mask_acl_save_command="${acl_save_command/$REDIS_DEFAULT_PASSWORD/********}" | ||
else | ||
acl_save_command="redis-cli -h localhost -p $SERVICE_PORT acl save" | ||
logging_mask_acl_save_command="$acl_save_command" | ||
fi | ||
echo "acl save command: $logging_mask_acl_save_command" | ||
if output=$($acl_save_command 2>&1); then | ||
echo "acl save command executed successfully: $output" | ||
else | ||
echo "failed to execute acl save command: $output" | ||
exit 1 | ||
fi | ||
} | ||
|
||
# This is magic for shellspec ut framework. | ||
# Sometime, functions are defined in a single shell script. | ||
# You will want to test it. but you do not want to run the script. | ||
# When included from shellspec, __SOURCED__ variable defined and script | ||
# end here. The script path is assigned to the __SOURCED__ variable. | ||
${__SOURCED__:+false} : || return 0 | ||
|
||
# main | ||
load_common_library | ||
acl_save_before_stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused