cert_controller_test.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. suite: test cert controller deployment
  2. templates:
  3. - cert-controller-deployment.yaml
  4. tests:
  5. - it: should match snapshot of default values
  6. asserts:
  7. - matchSnapshot: {}
  8. - it: should set imagePullPolicy to Always
  9. set:
  10. certController.image.pullPolicy: Always
  11. asserts:
  12. - equal:
  13. path: spec.template.spec.containers[0].imagePullPolicy
  14. value: Always
  15. - it: should imagePullPolicy to be default value IfNotPresent
  16. asserts:
  17. - equal:
  18. path: spec.template.spec.containers[0].imagePullPolicy
  19. value: IfNotPresent
  20. - it: should override securityContext
  21. set:
  22. certController.podSecurityContext:
  23. runAsUser: 2000
  24. certController.securityContext:
  25. runAsUser: 3000
  26. asserts:
  27. - equal:
  28. path: spec.template.spec.securityContext
  29. value:
  30. runAsUser: 2000
  31. - equal:
  32. path: spec.template.spec.containers[0].securityContext
  33. value:
  34. allowPrivilegeEscalation: false
  35. capabilities:
  36. drop:
  37. - ALL
  38. readOnlyRootFilesystem: true
  39. runAsNonRoot: true
  40. runAsUser: 3000
  41. seccompProfile:
  42. type: RuntimeDefault
  43. - it: should override hostNetwork
  44. set:
  45. certController.hostNetwork: true
  46. asserts:
  47. - equal:
  48. path: spec.template.spec.hostNetwork
  49. value: true
  50. - it: should override readinessProbe port
  51. set:
  52. certController.readinessProbe.port: 8082
  53. asserts:
  54. - equal:
  55. path: spec.template.spec.containers[0].args[7]
  56. value: "--healthz-addr=:8082"
  57. - it: should override metrics port
  58. set:
  59. certController.prometheus.service.port: 8888
  60. asserts:
  61. - equal:
  62. path: spec.template.spec.containers[0].args[6]
  63. value: "--metrics-addr=:8888"