suite: RoleBinding
templates:
  - rolebinding.yaml
tests:
  - it: Create a RoleBinding when upgrading
    release:
      isupgrade: true
    set:
      unitTestUpgrade: true
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: RoleBinding

  - it: creates a RoleBinding
    asserts:
      - hasDocuments:
          count: 1
      - isKind:
          of: RoleBinding
      - matchSnapshot: {}

  - it: sets RoleBinding labels when specified
    values:
      - ../.lint/extra-labels.yaml
    asserts:
      - equal:
          path: metadata.labels.app\.kubernetes\.io/name
          value: teleport-kube-agent
      - equal:
          path: metadata.labels.resource
          value: rolebinding
      - matchSnapshot: {}
