apiVersion: troubleshoot.sh/v1beta3
kind: SupportBundle
metadata:
  name: test-v1beta3-secretref
spec:
  collectors:
    # Test 1: PostgreSQL with URI from secret
    - postgres:
        collectorName: postgres-with-secret
        uri:
          valueFrom:
            secretKeyRef:
              name: test-database-credentials
              key: postgres-uri
        # This will fail to connect (fake server) but that's OK -
        # we're testing secret resolution, not actual DB connectivity

    # Test 2: PostgreSQL with TLS certs from secret
    - postgres:
        collectorName: postgres-with-tls
        uri:
          value: "postgresql://testuser:testpass@localhost:5432/testdb"
        tls:
          cacert:
            valueFrom:
              secretKeyRef:
                name: test-database-credentials
                key: ca.crt
          clientCert:
            valueFrom:
              secretKeyRef:
                name: test-database-credentials
                key: client.crt
          clientKey:
            valueFrom:
              secretKeyRef:
                name: test-database-credentials
                key: client.key

    # Test 3: MySQL with URI from secret
    - mysql:
        collectorName: mysql-with-secret
        uri:
          valueFrom:
            secretKeyRef:
              name: test-database-credentials
              key: mysql-uri

    # Test 4: Redis with URI from secret
    - redis:
        collectorName: redis-with-secret
        uri:
          valueFrom:
            secretKeyRef:
              name: test-database-credentials
              key: redis-uri

    # Test 5: Literal value (no secret) for comparison
    - clusterInfo: {}
