webhook_serviceaccount_test.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. suite: test webhook serviceaccount and secret
  2. templates:
  3. - webhook-serviceaccount.yaml
  4. tests:
  5. - it: should create ServiceAccount when webhook.create and webhook.serviceAccount.create are true
  6. set:
  7. webhook.create: true
  8. webhook.serviceAccount.create: true
  9. asserts:
  10. - containsDocument:
  11. apiVersion: v1
  12. kind: ServiceAccount
  13. - it: should create Secret and ServiceAccount when webhook.metrics.listen.auth.enabled webhook.create and webhook.serviceAccount.create set to true
  14. set:
  15. webhook.metrics.listen.auth.enabled: true
  16. webhook.create: true
  17. webhook.serviceAccount.create: true
  18. asserts:
  19. - hasDocuments:
  20. count: 2
  21. - it: should not create Secret when webhook.metrics.listen.auth.enabled is false
  22. set:
  23. webhook.metrics.listen.auth.enabled: false
  24. webhook.create: true
  25. webhook.serviceAccount.create: true
  26. asserts:
  27. - hasDocuments:
  28. count: 1
  29. - it: should not create Secret and ServiceAccount when webhook.create is false
  30. set:
  31. webhook.metrics.listen.auth.enabled: true
  32. webhook.create: false
  33. webhook.serviceAccount.create: true
  34. asserts:
  35. - hasDocuments:
  36. count: 0
  37. - it: should not create Secret and ServiceAccount when webhook.serviceAccount.create is false
  38. set:
  39. webhook.metrics.listen.auth.enabled: true
  40. webhook.create: true
  41. webhook.serviceAccount.create: false
  42. asserts:
  43. - hasDocuments:
  44. count: 0
  45. - it: should not create Secret and ServiceAccount when webhook.metrics.listen.auth.enabled webhook.serviceAccount.create webhook.create are false
  46. set:
  47. webhook.metrics.listen.auth.enabled: false
  48. webhook.create: false
  49. webhook.serviceAccount.create: false
  50. asserts:
  51. - hasDocuments:
  52. count: 0