apiVersion: troubleshoot.sh/v1beta2
kind: Preflight
metadata:
  name: sample
spec:
  collectors:
    - postgres:
        collectorName: pg
        uri: postgresql://user:password@hostname:5432/defaultdb?sslmode=require
  analyzers:
    - postgres:
        checkName: Must be postgres 10.x or later
        collectorName: pg
        outcomes:
          - fail:
              when: "connected == false"
              message: Cannot connect to postgres server
          - fail:
              when: "version < 10.x"
              message: The postgres server must be at least version 10
          - pass:
              message: The postgres connection checks out
