metadata_test.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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/managed-by: Helm
  51. app.kubernetes.io/version: *appVer
  52. g_label1: global_label1
  53. g_label2: global_label2
  54. label1: label1
  55. label2: label2
  56. - documentIndex: *serviceAccountDoc
  57. equal:
  58. path: automountServiceAccountToken
  59. value: false