suite: test service account deployments
templates:
  - celery/deployment.yaml
  - engine/deployment.yaml
  - engine/job-migrate.yaml
  - telegram-polling/deployment.yaml
release:
  name: oncall
tests:
  - it: serviceAccount.create=true -> should use created serviceAccount for deployments (default)
    set:
      telegramPolling.enabled: true
    asserts:
      - equal:
          path: spec.template.spec.serviceAccountName
          value: oncall

  - it: serviceAccount.create=false -> should use default serviceAccount for deployments
    set:
      telegramPolling.enabled: true
      serviceAccount.create: false
    asserts:
      - equal:
          path: spec.template.spec.serviceAccountName
          value: default

  - it: serviceAccount.name=custom -> should use created custom serviceAccount for deployments
    set:
      telegramPolling.enabled: true
      serviceAccount.name: custom
    asserts:
      - equal:
          path: spec.template.spec.serviceAccountName
          value: custom
