metadata_test.yaml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. suite: service account metadata test
  2. templates:
  3. - common.yaml
  4. chart:
  5. appVersion: &appVer v9.9.9
  6. tests:
  7. - it: should pass with service account 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. serviceAccount:
  21. my-sa1:
  22. enabled: true
  23. primary: true
  24. labels:
  25. label1: "{{ .Values.label1 }}"
  26. label2: label2
  27. annotations:
  28. annotation1: "{{ .Values.annotation1 }}"
  29. annotation2: annotation2
  30. asserts:
  31. - documentIndex: &serviceAccountDoc 0
  32. isKind:
  33. of: ServiceAccount
  34. - documentIndex: *serviceAccountDoc
  35. equal:
  36. path: metadata.annotations
  37. value:
  38. annotation1: annotation1
  39. annotation2: annotation2
  40. g_annotation1: global_annotation1
  41. g_annotation2: global_annotation2
  42. - documentIndex: *serviceAccountDoc
  43. equal:
  44. path: metadata.labels
  45. value:
  46. app: common-test-1.0.0
  47. release: RELEASE-NAME
  48. helm-revision: "0"
  49. helm.sh/chart: common-test-1.0.0
  50. app.kubernetes.io/name: common-test
  51. app.kubernetes.io/instance: RELEASE-NAME
  52. app.kubernetes.io/managed-by: Helm
  53. app.kubernetes.io/version: *appVer
  54. g_label1: global_label1
  55. g_label2: global_label2
  56. label1: label1
  57. label2: label2
  58. - documentIndex: *serviceAccountDoc
  59. equal:
  60. path: automountServiceAccountToken
  61. value: false