cert_controller_rbac_test.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. suite: test cert controller rbac
  2. templates:
  3. - cert-controller-rbac.yaml
  4. tests:
  5. - it: should keep get/list/watch on customresourcedefinitions cluster-wide
  6. documentIndex: 0
  7. asserts:
  8. - contains:
  9. path: rules
  10. content:
  11. apiGroups:
  12. - "apiextensions.k8s.io"
  13. resources:
  14. - "customresourcedefinitions"
  15. verbs:
  16. - "get"
  17. - "list"
  18. - "watch"
  19. - it: should scope customresourcedefinitions update/patch to the managed CRDs by resourceNames
  20. documentIndex: 0
  21. asserts:
  22. - contains:
  23. path: rules
  24. content:
  25. apiGroups:
  26. - "apiextensions.k8s.io"
  27. resources:
  28. - "customresourcedefinitions"
  29. resourceNames:
  30. - "externalsecrets.external-secrets.io"
  31. - "secretstores.external-secrets.io"
  32. - "clustersecretstores.external-secrets.io"
  33. verbs:
  34. - "update"
  35. - "patch"
  36. - notContains:
  37. path: rules
  38. content:
  39. apiGroups:
  40. - "apiextensions.k8s.io"
  41. resources:
  42. - "customresourcedefinitions"
  43. verbs:
  44. - "get"
  45. - "list"
  46. - "watch"
  47. - "update"
  48. - "patch"
  49. - it: should exclude clustersecretstores from the scoped CRD rule when createClusterSecretStore is false
  50. documentIndex: 0
  51. set:
  52. crds:
  53. createClusterSecretStore: false
  54. asserts:
  55. - contains:
  56. path: rules
  57. content:
  58. apiGroups:
  59. - "apiextensions.k8s.io"
  60. resources:
  61. - "customresourcedefinitions"
  62. resourceNames:
  63. - "externalsecrets.external-secrets.io"
  64. - "secretstores.external-secrets.io"
  65. verbs:
  66. - "update"
  67. - "patch"
  68. - it: should keep get/list/watch on secrets cluster-wide
  69. documentIndex: 0
  70. asserts:
  71. - contains:
  72. path: rules
  73. content:
  74. apiGroups:
  75. - ""
  76. resources:
  77. - "secrets"
  78. verbs:
  79. - "get"
  80. - "list"
  81. - "watch"
  82. - it: should scope secret update/patch to the webhook secret by resourceNames
  83. documentIndex: 0
  84. asserts:
  85. - contains:
  86. path: rules
  87. content:
  88. apiGroups:
  89. - ""
  90. resources:
  91. - "secrets"
  92. resourceNames:
  93. - "RELEASE-NAME-external-secrets-webhook"
  94. verbs:
  95. - "update"
  96. - "patch"
  97. - notContains:
  98. path: rules
  99. content:
  100. apiGroups:
  101. - ""
  102. resources:
  103. - "secrets"
  104. verbs:
  105. - "get"
  106. - "list"
  107. - "watch"
  108. - "update"
  109. - "patch"