apiVersion: batch/v1
kind: Job
metadata:
  name: psql-connect-uri
spec:
  backoffLimit: 3
  template:
    spec:
      restartPolicy: "OnFailure"
      containers:
        - name: psql
          image: ${KUTTL_PSQL_IMAGE}
          command:
            - psql
            - "$(PGURI)"
            - -c
            - "select version();"
          env:
          - name: PGURI
            valueFrom: { secretKeyRef: { name: password-change-pguser-password-change, key: uri } }
          
          # Do not wait indefinitely.
          - { name: PGCONNECT_TIMEOUT, value: '5' }
