apiVersion: batch/v1
kind: Job
metadata:
  name: validation-job
  namespace: besu-network
spec:
  template:
    spec:
      serviceAccountName: validation-sa
      containers:
        - name: validation
          image: bitnami/kubectl:1.28.0
          command:
            - /bin/bash
            - -c
            - |
              # Install dependencies
              apk add --no-cache curl jq bash
              
              # Run validations
              /scripts/validation/run-all-validations.sh
          volumeMounts:
            - name: validation-scripts
              mountPath: /scripts
            - name: kubeconfig
              mountPath: /root/.kube
          env:
            - name: NAMESPACE
              value: "besu-network"
      volumes:
        - name: validation-scripts
          configMap:
            name: validation-scripts
        - name: kubeconfig
          secret:
            secretName: kubeconfig
      restartPolicy: Never
  backoffLimit: 3

