clusterrole_test.yaml 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. suite: test clusterrole
  10. templates:
  11. - clusterrole.yaml
  12. tests:
  13. - it: should create a clusterrole when RBAC is enabled
  14. set:
  15. rbac.create: true
  16. asserts:
  17. - isKind:
  18. of: ClusterRole
  19. - contains:
  20. path: rules
  21. content:
  22. apiGroups: [""]
  23. resources: ["configmaps", "persistentvolumeclaims", "pods", "namespaces", "secrets", "serviceaccounts", "services"]
  24. verbs: ["create", "update", "patch", "delete", "get", "list", "watch"]
  25. - it: should not create a clusterrole when RBAC is disabled
  26. set:
  27. rbac.create: false
  28. asserts:
  29. - hasDocuments:
  30. count: 0