metadata_test.yaml 1.6 KB

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