You've already forked helm-gitea
### Description of the change
I've added the root label to the valkey domain that is searched by nc in the `configure_gitea.sh` script.
Here is an example of what the `test_valkey_connection` function will look like to the `configure-gitea` container:
```
function test_valkey_connection() {
local RETRY=0
local MAX=30
echo 'Wait for valkey to become avialable...'
until [ "${RETRY}" -ge "${MAX}" ]; do
nc -vz -w2 gitea-dev-valkey-cluster-headless.gitea-dev.svc.cluster.local. 6379 && break
RETRY=$[${RETRY}+1]
echo "...not ready yet (${RETRY}/${MAX})"
done
if [ "${RETRY}" -ge "${MAX}" ]; then
echo "Valkey not reachable after '${MAX}' attempts!"
exit 1
fi
}
```
### Benefits
If a search domain is set in resolve.conf, nc will append that root domain to the lookup, causing the lookup to fail. This will allow users to have a search domain set without causing the configure script to fail.
### Possible drawbacks
I don't believe there are any drawbacks, but let me know if I'm wrong.
### Applicable issues
gitea/helm-gitea#972
Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/982
Reviewed-by: Markus Pesch <volker.raschek@noreply.gitea.com>
Co-authored-by: David Chatterton <david@davidchatterton.com>
Co-committed-by: David Chatterton <david@davidchatterton.com>
This commit is contained in:
committed by
Markus Pesch
parent
9bf4e11faa
commit
3cc94ca9a6
@@ -64,7 +64,7 @@ stringData:
|
|||||||
|
|
||||||
echo 'Wait for valkey to become avialable...'
|
echo 'Wait for valkey to become avialable...'
|
||||||
until [ "${RETRY}" -ge "${MAX}" ]; do
|
until [ "${RETRY}" -ge "${MAX}" ]; do
|
||||||
nc -vz -w2 {{ include "valkey.servicename" . }} {{ include "valkey.port" . }} && break
|
RES_OPTIONS="ndots:0" nc -vz -w2 {{ include "valkey.servicename" . }} {{ include "valkey.port" . }} && break
|
||||||
RETRY=$[${RETRY}+1]
|
RETRY=$[${RETRY}+1]
|
||||||
echo "...not ready yet (${RETRY}/${MAX})"
|
echo "...not ready yet (${RETRY}/${MAX})"
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user