Files
helm-actions/docs/connectionCommandOverride.md
Daan e456879b7d
Some checks failed
changelog / changelog (push) Has been cancelled
check-and-test / check-and-test (push) Has been cancelled
feat: customize init command (#166)
add feature to customize the reach gitea commands.

See: https://gitea.com/gitea/helm-actions/src/branch/feat/customize-init-command/docs/connectionCommandOverride.mdReviewed-on: https://gitea.com/gitea/helm-actions/pulls/166
Co-authored-by: Daan <dselen@nerthus.nl>
2026-07-10 14:05:51 +00:00

1.5 KiB

Using a custom connectionCommand

By default, before the container starts it tries to reach the given giteaRootURL.
Normally this is done by the busybox image using the wget binary.

However, due to Issue #162 there has been a change made where we can customize that command.

Using the values.yaml file by default it calls wget --spider --no-check-certificate <your giteaRootURL> with a timeout of 10 seconds.
But with a custom init section like detailed below we can make our check compliant with whatever certificate you have.

Assuming:

enabled: true
giteaRootURL: https://gitea.com
existingSecret: foo
existingSecretKey: bar

init:
  image:
    registry: ""
    repository: alpine
    # Overrides the image tag whose default is the chart appVersion.
    tag: "3.24"
    digest: ""
    pullPolicy: IfNotPresent
    fullOverride: ""

  connectionCommandOverride: "curl -I"
  preConnectionCommandOverride: "apk add curl"

This now creates the following template section:

        - name: init-gitea
          image: "alpine:latest"
          command:
            - sh
            - -c
            - |
              apk add curl
              echo 'Trying to reach Gitea on https://gitea.com'
              until timeout 10 curl -I https://gitea.com; do
                sleep 3
                echo "Trying again in 3 seconds..."
              done
              echo "Gitea has been reached!"