data_test.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. suite: imagePullSecret data test
  2. templates:
  3. - common.yaml
  4. tests:
  5. - it: should pass with data
  6. set:
  7. imagePullSecret:
  8. my-secret1:
  9. enabled: true
  10. data:
  11. registry: reg
  12. username: user
  13. password: pass
  14. email: mail
  15. asserts:
  16. - documentIndex: &secretDoc 0
  17. isKind:
  18. of: Secret
  19. - documentIndex: *secretDoc
  20. equal:
  21. path: data
  22. value:
  23. .dockerconfigjson: eyJhdXRocyI6eyJyZWdpc3RyeSI6eyJhdXRoIjoiZFhObGNqcHdZWE56IiwiZW1haWwiOiJtYWlsIiwicGFzc3dvcmQiOiJwYXNzIiwidXNlcm5hbWUiOiJ1c2VyIn19fQ==
  24. - documentIndex: *secretDoc
  25. equal:
  26. path: type
  27. value: kubernetes.io/dockerconfigjson
  28. - it: should pass with data from tpl
  29. set:
  30. registry: quay.io
  31. user: user
  32. pass: secret_pass
  33. email: mail@example.com
  34. imagePullSecret:
  35. my-secret1:
  36. enabled: true
  37. data:
  38. registry: "{{ .Values.registry }}"
  39. username: "{{ .Values.user }}"
  40. password: "{{ .Values.pass }}"
  41. email: "{{ .Values.email }}"
  42. asserts:
  43. - documentIndex: *secretDoc
  44. equal:
  45. path: data
  46. value:
  47. .dockerconfigjson: eyJhdXRocyI6eyJyZWdpc3RyeSI6eyJhdXRoIjoiZFhObGNqcHpaV055WlhSZmNHRnpjdz09IiwiZW1haWwiOiJtYWlsQGV4YW1wbGUuY29tIiwicGFzc3dvcmQiOiJzZWNyZXRfcGFzcyIsInVzZXJuYW1lIjoidXNlciJ9fX0=