suite: certificate name test
templates:
  - common.yaml
tests:
  - it: should generate correct name
    set:
      ixCertificates:
        "1":
          certificate: some_cert
          privatekey: some_key
        "2":
          certificate: some_cert
          privatekey: some_key
      scaleCertificate:
        my-cert1:
          enabled: true
          id: 1
        my-cert2:
          enabled: true
          id: 2
    asserts:
      - documentIndex: &secretDoc 0
        isKind:
          of: Secret
      - documentIndex: *secretDoc
        isAPIVersion:
          of: v1
      - documentIndex: *secretDoc
        equal:
          path: metadata.name
          value: release-name-common-test-my-cert1
      - documentIndex: &otherSecretDoc 1
        isKind:
          of: Secret
      - documentIndex: *otherSecretDoc
        isAPIVersion:
          of: v1
      - documentIndex: *otherSecretDoc
        equal:
          path: metadata.name
          value: release-name-common-test-my-cert2
