controller_test.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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