suite: Controller Secret Claims
release:
  name: my-release
  namespace: my-namespace
templates:
  - secret-claims.yaml
tests:
  - it: tests defaults
    asserts:
    - hasDocuments:
        count: 0
  - it: tests 2 secret claims
    set:
      controller.secretClaims:
        - name: simple-secret
          path: secret/path
        - name: complex-secret
          path: secret/complex
          type: kubernetes.io/tls
          renew: 60
    asserts:
      - hasDocuments:
          count: 2
      - documentIndex: 0
        isKind:
          of: SecretClaim
      - documentIndex: 0
        equal:
          path: apiVersion
          value: vaultproject.io/v1
      - documentIndex: 0
        equal:
          path: metadata.name
          value: my-release-jenkins-simple-secret
      - documentIndex: 0
        matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - documentIndex: 0
        isNull:
          path: metadata.annotations
      - documentIndex: 0
        equal:
          path: spec.type
          value: Opaque
      - documentIndex: 0
        equal:
          path: spec.path
          value: secret/path
      - documentIndex: 0
        isNull:
          path: spec.renew
      - documentIndex: 1
        isKind:
          of: SecretClaim
      - documentIndex: 1
        equal:
          path: apiVersion
          value: vaultproject.io/v1
      - documentIndex: 1
        equal:
          path: metadata.name
          value: my-release-jenkins-complex-secret
      - documentIndex: 1
        matchRegex:
          path: metadata.labels.helm\.sh/chart
          pattern: ^jenkins-
      - documentIndex: 1
        isNull:
          path: metadata.annotations
      - documentIndex: 1
        equal:
          path: spec.type
          value: kubernetes.io/tls
      - documentIndex: 1
        equal:
          path: spec.path
          value: secret/complex
      - documentIndex: 1
        equal:
          path: spec.renew
          value: 60