suite: ConfigMap
templates:
  - config.yaml
tests:
  - it: matches snapshot for affinity.yaml
    values:
      - ../.lint/affinity.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for all-v6.yaml
    values:
      - ../.lint/all-v6.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot and tests for extra-labels.yaml
    values:
      - ../.lint/extra-labels.yaml
    asserts:
      - equal:
          path: metadata.labels.app\.kubernetes\.io/name
          value: teleport-kube-agent
      - equal:
          path: metadata.labels.resource
          value: config
      - matchSnapshot: {}

  - it: matches snapshot and tests for annotations.yaml
    values:
      - ../.lint/annotations.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - equal:
          path: metadata.annotations.kubernetes\.io/config
          value: test-annotation
      - equal:
          path: metadata.annotations.kubernetes\.io/config-different
          value: 2
      - matchSnapshot: {}

  - it: matches snapshot for aws-databases.yaml
    values:
      - ../.lint/aws-databases.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for azure-databases.yaml
    values:
      - ../.lint/azure-databases.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for backwards-compatibility.yaml
    values:
      - ../.lint/backwards-compatibility.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for ca-pin.yaml
    values:
      - ../.lint/ca-pin.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: does not generate a config for clusterrole.yaml
    values:
      - ../.lint/clusterrole.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for db.yaml
    values:
      - ../.lint/db.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for dynamic-app.yaml
    values:
      - ../.lint/dynamic-app.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for dynamic-db.yaml
    values:
      - ../.lint/dynamic-db.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for imagepullsecrets.yaml
    values:
      - ../.lint/imagepullsecrets.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for initcontainers.yaml
    values:
      - ../.lint/initcontainers.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for join-params-iam.yaml
    values:
      - ../.lint/join-params-iam.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for join-params-token.yaml
    values:
      - ../.lint/join-params-token.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for log-basic.yaml
    values:
      - ../.lint/log-basic.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for log-extra.yaml
    values:
      - ../.lint/log-extra.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for log-legacy.yaml
    values:
      - ../.lint/log-legacy.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for node-selector.yaml
    values:
      - ../.lint/node-selector.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for pdb.yaml
    values:
      - ../.lint/log-extra.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: does not generate a config for pdb.yaml
    values:
      - ../.lint/pdb.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for resources.yaml
    values:
      - ../.lint/resources.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for stateful.yaml
    values:
      - ../.lint/stateful.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for tolerations.yaml
    values:
      - ../.lint/tolerations.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for volumes.yaml
    values:
      - ../.lint/volumes.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for v10.yaml
    values:
      - ../.lint/v10.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}

  - it: matches snapshot for v11.yaml
    values:
      - ../.lint/v11.yaml
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: ConfigMap
      - matchSnapshot: {}
