controller_test.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. suite: test controller deployment
  2. templates:
  3. - 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. 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. podSecurityContext:
  23. runAsUser: 2000
  24. 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. hostNetwork: true
  46. asserts:
  47. - equal:
  48. path: spec.template.spec.hostNetwork
  49. value: true
  50. - it: should override metrics port
  51. set:
  52. metrics.listen.port: 8888
  53. asserts:
  54. - equal:
  55. path: spec.template.spec.containers[0].args[1]
  56. value: "--metrics-addr=:8888"