apiVersion: batch/v1
kind: Job
metadata:
  name:  vault-wilcard-get-all-keys
spec:
  backoffLimit: 1
  completions: 1
  parallelism: 1
  template:
    metadata:
      name:  vault-wilcard-get-all-keys
      annotations:
        vault.secret.manager/enabled: "true"
        vault.secret.manager/service: "https://vault.default.svc.cluster.local:8200"
        vault.secret.manager/tls-secret-name: "vault-consul-ca"
        vault.secret.manager/role: "tester"
        vault.secret.manager/path: "secrets/v2/plain/secrets/db*"
    spec:
      restartPolicy: Never
      serviceAccountName: tester
      containers:
      - name: alpine
        image: alpine
        command:
          - "sh"
          - "-c"
          - |
              echo "testing subtree each path as key name with a single value"
              [ -n "$USER" ] && echo "USER: $USER"
              [ -n "$PASSWORD" ] && echo "PASSWORD: $PASSWORD"
              [ -n "$PARAM1" ] && echo "PARAM1: $PARAM1"
              [ -n "$PARAM2" ] && echo "PARAM2: $PARAM2"
              [ -n "$PARAM3" ] && echo "PARAM3: $PARAM3"
              exit 0
        resources:
            limits:
              cpu: 0.5m
              memory: 100M
