From 3cc94ca9a67060f86f606b420cc2adafb83f4d29 Mon Sep 17 00:00:00 2001 From: David Chatterton Date: Fri, 23 Jan 2026 22:49:58 +0000 Subject: [PATCH] fix(valkey): suppress search domain queries for valkeys headless service [Close #972] (#982) ### 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 Co-authored-by: David Chatterton Co-committed-by: David Chatterton --- templates/gitea/init.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/gitea/init.yaml b/templates/gitea/init.yaml index 2c30c9f..8927ba7 100644 --- a/templates/gitea/init.yaml +++ b/templates/gitea/init.yaml @@ -64,7 +64,7 @@ stringData: echo 'Wait for valkey to become avialable...' 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] echo "...not ready yet (${RETRY}/${MAX})" done @@ -225,4 +225,4 @@ stringData: configure_oauth - echo '==== END GITEA CONFIGURATION ====' \ No newline at end of file + echo '==== END GITEA CONFIGURATION ===='