suite: Secret configuration
templates:
  - "secret.yaml"
  - "deployment.yaml"
tests:
  - it: should not provide secret by default
    template: "secret.yaml"
    asserts:
      - hasDocuments:
          count: 0

  - it: should configure Azure secret
    release:
      name: under-test
    set:
      secretConfiguration:
        enabled: true
        mountPath: "/etc/kubernetes/"
        data:
          azure.json: |
            {
              "tenantId": "00000000-0000-0000-0000-000000000000",
              "subscriptionId": "00000000-0000-0000-0000-000000000000",
              "resourceGroup": "networking",
              "useWorkloadIdentityExtension": true
            }
    asserts:
      - hasDocuments:
          count: 1
      - exists:
          path: data["azure.json"]
        template: "secret.yaml"
      - exists:
          path: spec.template.spec.volumes
        template: "deployment.yaml"
      - equal:
          path: spec.template.spec.volumes
          value:
            - name: secrets
              secret:
                secretName: under-test-external-dns
        template: "deployment.yaml"
