metadata_test.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. suite: imagePullSecret metadata test
  2. templates:
  3. - common.yaml
  4. chart:
  5. appVersion: &appVer v9.9.9
  6. tests:
  7. - it: should pass with secret created with labels and annotations
  8. set:
  9. label1: label1
  10. label2: global_label2
  11. annotation1: annotation1
  12. annotation2: global_annotation2
  13. global:
  14. labels:
  15. g_label1: global_label1
  16. g_label2: "{{ .Values.label2 }}"
  17. annotations:
  18. g_annotation1: global_annotation1
  19. g_annotation2: "{{ .Values.annotation2 }}"
  20. imagePullSecret:
  21. my-secret1:
  22. enabled: true
  23. labels:
  24. label1: "{{ .Values.label1 }}"
  25. label2: label2
  26. annotations:
  27. annotation1: "{{ .Values.annotation1 }}"
  28. annotation2: annotation2
  29. data:
  30. registry: reg
  31. username: user
  32. password: pass
  33. email: mail
  34. asserts:
  35. - documentIndex: &secretDoc 0
  36. isKind:
  37. of: Secret
  38. - documentIndex: *secretDoc
  39. equal:
  40. path: metadata.annotations
  41. value:
  42. annotation1: annotation1
  43. annotation2: annotation2
  44. g_annotation1: global_annotation1
  45. g_annotation2: global_annotation2
  46. - documentIndex: *secretDoc
  47. equal:
  48. path: metadata.labels
  49. value:
  50. app: common-test-1.0.0
  51. release: RELEASE-NAME
  52. helm-revision: "0"
  53. helm.sh/chart: common-test-1.0.0
  54. app.kubernetes.io/name: common-test
  55. app.kubernetes.io/instance: RELEASE-NAME
  56. app.kubernetes.io/managed-by: Helm
  57. app.kubernetes.io/version: *appVer
  58. g_label1: global_label1
  59. g_label2: global_label2
  60. label1: label1
  61. label2: label2