DandyDeveloper / charts

Various helm charts migrated from [helm/stable] due to deprecation
https://dandydeveloper.github.io/charts
Apache License 2.0
157 stars 145 forks source link

[chart/redis-ha] split-brain-fix.sh is executed on "sh" but uses "==" instead of "=" for comparison #229

Closed ramanNarasimhan77 closed 2 years ago

ramanNarasimhan77 commented 2 years ago

Hello, I'm trying to install argocd helm chart and it has a dependency on redis-ha.

Observed that sometimes, the redis pods keep crashing and go into crash loop back off state; and on checking logs for errors I noticed the following error appearing repeatedly in the split-brain-fix container logs

+ [ 10.104.191.33 == 10.104.191.33 ]                                                                                                                      │
/readonly-config/fix-split-brain.sh: 276: [: 10.104.191.33: unexpected operator

Note: I edited the container command/args to run the script in debug mode by adding -x

Though I am not sure if the redis container crash loop is related to this error, while debugging I found that this error is caused because the script is invoked using "sh" which does not support comparison using "==" operator Comparison using "==" is being done in fix-split-brain.sh:276

I think this issue is causing the flow-of-control to always go into the else block

Reference: https://www.shellcheck.net/wiki/SC3014

DandyDeveloper commented 2 years ago

@ramanNarasimhan77 This will specifically be the split-brain container failing on a specific part of the shell script that it uses to determine split brain state.

I'm going to take a quick look. Possible a simple mistake made by a recent commit.

DandyDeveloper commented 2 years ago

image

This would be valid if we were using bash, but pretty sure the alpine and script is called using POSIX/Shell. So it probably should be =.