From 89a7ccacb06af7739f5155c6cc47c098319555fc Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 15 May 2024 17:50:11 +0200 Subject: [PATCH] Fixing dind connection error --- forgejo-runner/templates/deployment.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/forgejo-runner/templates/deployment.yaml b/forgejo-runner/templates/deployment.yaml index acf801c..3b9a77c 100644 --- a/forgejo-runner/templates/deployment.yaml +++ b/forgejo-runner/templates/deployment.yaml @@ -34,7 +34,14 @@ spec: - name: make-config-writeable image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: [ "/bin/cp", "/etc/runner/.runner", "/data/.runner" ] + command: [ "sh", "-c" ] + args: + - | + cp /etc/runner/.runner /data/.runner && forgejo-runner generate-config > /data/config.yml ; + sed -i -e "s|network: .*|network: host|" config.yml ; + sed -i -e "s|^ envs:$$| envs:\n DOCKER_HOST: tcp://localhost:2376\n DOCKER_TLS_VERIFY: 1\n DOCKER_CERT_PATH: /certs/client|" config.yml ; + sed -i -e "s|^ options:| options: -v /certs/client:/certs/client|" config.yml ; + sed -i -e "s| valid_volumes: \[\]$$| valid_volumes:\n - /certs/client|" config.yml ; resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: @@ -48,12 +55,12 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - command: [ "/bin/forgejo-runner", "daemon" ] + command: ["sh", "-c", "while ! nc -z localhost 2376