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

Fixed variable comparisons in shutdown.sh and ready.sh #365

Merged
merged 1 commit into from
Feb 3, 2022

Conversation

erste
Copy link

@erste erste commented Jan 27, 2022

Fixes #363 .

Changes proposed on the PR:

  • You are using /bin/sh to run shutdown.sh and ready.sh, but sh in Debian containers don't understand "==" and "[[ ]]" operands.

@erste erste requested a review from ese as a code owner January 27, 2022 15:34
@ese
Copy link
Member

ese commented Feb 1, 2022

Thanks @erste have you tested it with alpine and debian?

@erste
Copy link
Author

erste commented Feb 1, 2022

Yes. With auth and without it.

For Debian:

I have no name!@rfr-redisfailover6-0:/data$ sh -x /redis-readiness/ready.sh
+ ROLE=role
+ ROLE_MASTER=role:master
+ ROLE_SLAVE=role:slave
+ IN_SYNC=master_sync_in_progress:1
+ NO_MASTER=master_host:127.0.0.1
+ cmd=redis-cli
+ [ ! -z  ]
+ cmd=redis-cli info replication
+ echo redis-cli info replication | grep role | tr -d "\r" | tr -d "\n"
+ xargs -0 sh -c
+ role=role:master
+ check_master
+ exit 0

For alpine:

/data $ sh -x /redis-readiness/ready.sh
+ ROLE=role
+ ROLE_MASTER=role:master
+ ROLE_SLAVE=role:slave
+ IN_SYNC=master_sync_in_progress:1
+ NO_MASTER=master_host:127.0.0.1
+ cmd=redis-cli
+ '[' '!' -z  ]
+ cmd='redis-cli info replication'
+ echo 'redis-cli info replication | grep role | tr -d "\r" | tr -d "\n"'
+ xargs -0 sh -c
+ role=role:master
+ check_master
+ exit 0

@ese
Copy link
Member

ese commented Feb 3, 2022

Perfect, thank you so much

@ese ese merged commit a17632e into spotahome:master Feb 3, 2022
@erste erste deleted the fix-configmaps-sh-syntax-errors branch February 4, 2022 10:55
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.

v1.1.0 breaks readiness probes for 6.2.6
2 participants