global_values_schema_test.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. suite: test global values schema validation
  2. # This test validates that the JSON schema correctly defines the new global values
  3. templates:
  4. - deployment.yaml
  5. tests:
  6. - it: should accept valid global.podLabels
  7. set:
  8. global.podLabels:
  9. app: "myapp"
  10. environment: "production"
  11. asserts:
  12. - isKind:
  13. of: Deployment
  14. - it: should accept valid global.podAnnotations
  15. set:
  16. global.podAnnotations:
  17. prometheus.io/scrape: "true"
  18. custom-annotation: "value"
  19. asserts:
  20. - isKind:
  21. of: Deployment
  22. - it: should accept valid global.imagePullSecrets
  23. set:
  24. global.imagePullSecrets:
  25. - name: "my-registry-secret"
  26. - name: "another-secret"
  27. asserts:
  28. - isKind:
  29. of: Deployment
  30. - it: should accept valid global.repository as string
  31. set:
  32. global.repository: "my-registry.io/org/external-secrets"
  33. asserts:
  34. - isKind:
  35. of: Deployment
  36. - it: should accept empty global.repository string
  37. set:
  38. global.repository: ""
  39. asserts:
  40. - isKind:
  41. of: Deployment
  42. - it: should accept all global values together
  43. set:
  44. global.repository: "my-registry.io/org/external-secrets"
  45. global.imagePullSecrets:
  46. - name: "global-secret"
  47. global.podLabels:
  48. team: "platform"
  49. global.podAnnotations:
  50. version: "1.0.0"
  51. asserts:
  52. - isKind:
  53. of: Deployment
  54. - equal:
  55. path: spec.template.metadata.labels.team
  56. value: "platform"
  57. - equal:
  58. path: spec.template.metadata.annotations.version
  59. value: "1.0.0"
  60. - equal:
  61. path: spec.template.spec.imagePullSecrets[0].name
  62. value: "global-secret"