suite: Test Cluster Role Bindings
templates:
- clusterrolebinding.yaml
tests:
- it: should render Cluster Role Bindings with default rbac api version
  set:
    rbac.apiVersion: v1
  asserts:
  - equal:
      path: apiVersion
      value: rbac.authorization.k8s.io/v1
- it: should render Cluster Role Bindings with custom rbac api version
  set:
    rbac.apiVersion: v1beta
  asserts:
  - equal:
      path: apiVersion
      value: rbac.authorization.k8s.io/v1beta
- it: should not render Cluster Role Binding proxy if metrics.enabled = false or metrics.authProxy.enabled = false
  set:
    metrics.enabled: false
    metrics.authProxy.enabled: false
  asserts:
  - hasDocuments:
      count: 1
    template: clusterrolebinding.yaml
- it: should render Cluster Role Bindings proxy if metrics.enabled = true and metrics.authProxy.enabled = true
  set:
    metrics.enabled: true
    metrics.authProxy.enabled: true
  asserts:
  - hasDocuments:
      count: 2
    template: clusterrolebinding.yaml
- it: should render Cluster Role Bindings with default rbac api version if metrics.enabled = true and metrics.authProxy.enabled = true
  set:
    metrics.enabled: true
    metrics.authProxy.enabled: true
  asserts:
  - equal:
      path: apiVersion
      value: rbac.authorization.k8s.io/v1