adeploy 1.3.2__tar.gz → 1.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. {adeploy-1.3.2 → adeploy-1.3.4}/.gitignore +2 -0
  2. {adeploy-1.3.2 → adeploy-1.3.4}/PKG-INFO +2 -2
  3. {adeploy-1.3.2 → adeploy-1.3.4}/docs/hooks/asciinema.py +1 -0
  4. {adeploy-1.3.2 → adeploy-1.3.4}/docs/hooks/badges.py +4 -3
  5. {adeploy-1.3.2 → adeploy-1.3.4}/pyproject.toml +1 -1
  6. adeploy-1.3.4/renovate.json +3 -0
  7. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/args.py +0 -1
  8. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/colors.py +1 -1
  9. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/deployment.py +10 -10
  10. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/errors.py +0 -12
  11. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/helpers.py +12 -13
  12. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/jinja/dict.py +1 -1
  13. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/jinja/env.py +10 -9
  14. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/jinja/filters.py +2 -2
  15. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/jinja/globals.py +34 -35
  16. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/kubectl.py +16 -14
  17. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/logging.py +1 -1
  18. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/provider.py +5 -7
  19. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets/__init__.py +3 -3
  20. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets/docker_registry_secret.py +7 -5
  21. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets/generic_secret.py +7 -5
  22. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets/secret.py +22 -20
  23. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets/tls_secret.py +9 -7
  24. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/gopass_provider.py +8 -10
  25. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/plaintext_provider.py +0 -2
  26. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/provider.py +2 -4
  27. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/random_provider.py +2 -2
  28. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/shell_command_provider.py +3 -1
  29. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/version.py +1 -1
  30. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/find.py +3 -7
  31. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/labels.py +1 -2
  32. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/probes.py +2 -1
  33. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/resources.py +1 -0
  34. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/update.py +2 -1
  35. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/main.py +7 -10
  36. {adeploy-1.3.2/src/adeploy/providers/jinja → adeploy-1.3.4/src/adeploy/providers/helm}/__init__.py +2 -2
  37. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/common/__init__.py +11 -10
  38. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/renderer.py +9 -4
  39. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/tester.py +3 -4
  40. {adeploy-1.3.2/src/adeploy/providers/helm → adeploy-1.3.4/src/adeploy/providers/jinja}/__init__.py +2 -2
  41. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/jinja/deployer.py +1 -2
  42. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/jinja/renderer.py +1 -1
  43. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/jinja/tester.py +2 -3
  44. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/jinja/watcher.py +5 -3
  45. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/__init__.py +4 -4
  46. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/config.py +1 -0
  47. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/PKG-INFO +2 -2
  48. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/SOURCES.txt +1 -0
  49. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/requires.txt +1 -1
  50. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/scm_file_list.json +214 -213
  51. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/scm_version.json +2 -2
  52. {adeploy-1.3.2 → adeploy-1.3.4}/tests/test_release_fragments.py +33 -1
  53. {adeploy-1.3.2 → adeploy-1.3.4}/uv.lock +5 -5
  54. {adeploy-1.3.2 → adeploy-1.3.4}/.awesome.yml +0 -0
  55. {adeploy-1.3.2 → adeploy-1.3.4}/.gitlab-ci.yml +0 -0
  56. {adeploy-1.3.2 → adeploy-1.3.4}/DEVELOP.md +0 -0
  57. {adeploy-1.3.2 → adeploy-1.3.4}/LICENSE +0 -0
  58. {adeploy-1.3.2 → adeploy-1.3.4}/README.md +0 -0
  59. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/css/asciinema-player.css +0 -0
  60. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/css/badges.css +0 -0
  61. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/css/docstrings.css +0 -0
  62. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/css/footer.css +0 -0
  63. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/download.sh +0 -0
  64. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/img/awesome-logo.png +0 -0
  65. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/js/asciinema-init.js +0 -0
  66. {adeploy-1.3.2 → adeploy-1.3.4}/docs/assets/js/asciinema-player.min.js +0 -0
  67. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/_more.md +0 -0
  68. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/filters.md +0 -0
  69. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/functions.md +0 -0
  70. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/includes.md +0 -0
  71. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/index.md +0 -0
  72. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/labels.md +0 -0
  73. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/macros.md +0 -0
  74. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/probes.md +0 -0
  75. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/resource-limits.md +0 -0
  76. {adeploy-1.3.2 → adeploy-1.3.4}/docs/common/secrets.md +0 -0
  77. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm/helm-deploy.cast +0 -0
  78. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm/helm-render.cast +0 -0
  79. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm/helm-test.cast +0 -0
  80. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm/hooks.md +0 -0
  81. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm/index.md +0 -0
  82. {adeploy-1.3.2 → adeploy-1.3.4}/docs/helm.cast +0 -0
  83. {adeploy-1.3.2 → adeploy-1.3.4}/docs/index.md +0 -0
  84. {adeploy-1.3.2 → adeploy-1.3.4}/docs/install.md +0 -0
  85. {adeploy-1.3.2 → adeploy-1.3.4}/docs/jinja/index.md +0 -0
  86. {adeploy-1.3.2 → adeploy-1.3.4}/docs/jinja/jinja-deploy.cast +0 -0
  87. {adeploy-1.3.2 → adeploy-1.3.4}/docs/jinja/jinja-render.cast +0 -0
  88. {adeploy-1.3.2 → adeploy-1.3.4}/docs/jinja/jinja-test.cast +0 -0
  89. {adeploy-1.3.2 → adeploy-1.3.4}/docs/jinja.cast +0 -0
  90. {adeploy-1.3.2 → adeploy-1.3.4}/docs/overrides/partials/copyright.html +0 -0
  91. {adeploy-1.3.2 → adeploy-1.3.4}/docs/usage.md +0 -0
  92. {adeploy-1.3.2 → adeploy-1.3.4}/examples/.exclude-from-test +0 -0
  93. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/README.md +0 -0
  94. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/.helmignore +0 -0
  95. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/Chart.yaml +0 -0
  96. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/README.md +0 -0
  97. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
  98. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
  99. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
  100. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/service.yaml +0 -0
  101. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
  102. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/values.yaml +0 -0
  103. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/prod/manifest.yml +0 -0
  104. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/prod/values.yml +0 -0
  105. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/manifest.yml +0 -0
  106. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/values.yml +0 -0
  107. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/defaults.yml +0 -0
  108. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/prod/000-common.yml +0 -0
  109. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/prod/010-service-account.yml +0 -0
  110. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/test.yml +0 -0
  111. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/README.md +0 -0
  112. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/.helmignore +0 -0
  113. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/Chart.yaml +0 -0
  114. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/README.md +0 -0
  115. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
  116. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
  117. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
  118. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/service.yaml +0 -0
  119. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
  120. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/values.yaml +0 -0
  121. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/playground/hello-world/test/manifest.yml +0 -0
  122. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/playground/hello-world/test/values.yml +0 -0
  123. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/defaults.yml +0 -0
  124. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/hooks/patch.sh +0 -0
  125. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/hooks/patches.d/001-add-env.patch +0 -0
  126. {adeploy-1.3.2 → adeploy-1.3.4}/examples/helm/002-hooks/namespaces/playground/test.yml +0 -0
  127. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/.exclude-from-test +0 -0
  128. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/README.md +0 -0
  129. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/deployment.yml +0 -0
  130. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/job.yml +0 -0
  131. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/deployment.yml +0 -0
  132. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/job.yml +0 -0
  133. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/defaults.yml +0 -0
  134. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/prod/000-common.yml +0 -0
  135. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/prod/010-nginx.yml +0 -0
  136. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/test.yml +0 -0
  137. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/templates/deployment.yml +0 -0
  138. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/001-general-structure/templates/job.yml +0 -0
  139. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/README.md +0 -0
  140. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
  141. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
  142. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
  143. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
  144. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/prod/deployment.yml +0 -0
  145. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/test/deployment.yml +0 -0
  146. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/defaults.yml +0 -0
  147. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/prod.yml +0 -0
  148. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_prod +0 -0
  149. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_test +0 -0
  150. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/test.yml +0 -0
  151. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets/templates/deployment.yml +0 -0
  152. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/README.md +0 -0
  153. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-6e1adb2c4c075e35335e851dd6ebc5f0f7397a80 +0 -0
  154. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
  155. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
  156. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
  157. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-dcf2a6e7bd78ee395f73f6434b19a9044790c00a +0 -0
  158. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
  159. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/deployment.yml +0 -0
  160. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/ingress.yml +0 -0
  161. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/deployment.yml +0 -0
  162. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/ingress.yml +0 -0
  163. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/defaults.yml +0 -0
  164. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/prod.yml +0 -0
  165. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.crt +0 -0
  166. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.key +0 -0
  167. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.crt +0 -0
  168. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.key +0 -0
  169. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_prod +0 -0
  170. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_test +0 -0
  171. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/test.yml +0 -0
  172. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/templates/deployment.yml +0 -0
  173. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/templates/ingress.yml +0 -0
  174. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/README.md +0 -0
  175. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/common/configmap.yml +0 -0
  176. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/nginx/deployment.yml +0 -0
  177. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/redis/deployment.yml +0 -0
  178. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/common/configmap.yml +0 -0
  179. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/nginx/deployment.yml +0 -0
  180. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/redis/deployment.yml +0 -0
  181. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/defaults.yml +0 -0
  182. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/namespaces/playground/prod.yml +0 -0
  183. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/namespaces/playground/test.yml +0 -0
  184. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/__affinity.yml +0 -0
  185. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/__env.yml +0 -0
  186. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/configmap.yml +0 -0
  187. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/conf.d/alpha.json +0 -0
  188. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/conf.d/beta.json +0 -0
  189. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/nginx.conf +0 -0
  190. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/nginx/deployment.yml +0 -0
  191. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/003-include/templates/redis/deployment.yml +0 -0
  192. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/README.md +0 -0
  193. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/nginx/deployment.yml +0 -0
  194. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/redis/deployment.yml +0 -0
  195. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/nginx/deployment.yml +0 -0
  196. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/redis/deployment.yml +0 -0
  197. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/defaults.yml +0 -0
  198. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/namespaces/playground/prod.yml +0 -0
  199. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/namespaces/playground/test.yml +0 -0
  200. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/templates/nginx/deployment.yml +0 -0
  201. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/004-probes/templates/redis/deployment.yml +0 -0
  202. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/README.md +0 -0
  203. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/build/jinja/playground/005-labels/prod/deployment.yml +0 -0
  204. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/build/jinja/playground/005-labels/test/deployment.yml +0 -0
  205. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/defaults.yml +0 -0
  206. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/namespaces/playground/prod.yml +0 -0
  207. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/namespaces/playground/test.yml +0 -0
  208. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/005-labels/templates/deployment.yml +0 -0
  209. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/README.md +0 -0
  210. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/prod/deployment.yml +0 -0
  211. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/test/deployment.yml +0 -0
  212. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/defaults.yml +0 -0
  213. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/namespaces/playground/prod.yml +0 -0
  214. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/namespaces/playground/test.yml +0 -0
  215. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/006-nested-labels/templates/deployment.yml +0 -0
  216. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/README.md +0 -0
  217. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/nginx/deployment.yml +0 -0
  218. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/redis/deployment.yml +0 -0
  219. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/nginx/deployment.yml +0 -0
  220. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/redis/deployment.yml +0 -0
  221. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/defaults.yml +0 -0
  222. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/namespaces/playground/prod.yml +0 -0
  223. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/namespaces/playground/test.yml +0 -0
  224. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/templates/nginx/deployment.yml +0 -0
  225. {adeploy-1.3.2 → adeploy-1.3.4}/examples/jinja/007-resources/templates/redis/deployment.yml +0 -0
  226. {adeploy-1.3.2 → adeploy-1.3.4}/mkdocs.yml +0 -0
  227. {adeploy-1.3.2 → adeploy-1.3.4}/setup.cfg +0 -0
  228. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/__init__.py +0 -0
  229. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/__main__.py +0 -0
  230. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/__init__.py +0 -0
  231. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/jinja/__init__.py +0 -0
  232. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/__init__.py +0 -0
  233. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/common/yaml/__init__.py +0 -0
  234. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/__init__.py +0 -0
  235. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/README.md +0 -0
  236. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm.py +2 -2
  237. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm_output.py +0 -0
  238. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm_provider.py +0 -0
  239. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/deployer.py +1 -1
  240. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/helm/watcher.py +0 -0
  241. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/providers/jinja/README.md +0 -0
  242. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/deploy.py +0 -0
  243. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/render.py +0 -0
  244. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/test.py +0 -0
  245. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy/steps/watch.py +0 -0
  246. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/dependency_links.txt +0 -0
  247. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/entry_points.txt +0 -0
  248. {adeploy-1.3.2 → adeploy-1.3.4}/src/adeploy.egg-info/top_level.txt +0 -0
@@ -107,3 +107,5 @@ venv.bak/
107
107
 
108
108
  .idea/
109
109
  .asandbox/
110
+ bin
111
+ code-quality-report.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: adeploy
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: Universal deployment tool for Kubernetes that supports rendering and deployment of lightweight Jinja templated k8s manifests as well as complex Helm charts.
5
5
  Author-email: Daniel Morlock <daniel.morlock@awesome-it.de>, Daniel Bross <daniel.bross@awesome-it.de>, Adrian Vielsack <adrian.vielsack@awesome-it.de>, Philip Flohr <philip.flohr@awesome-it.de>
6
6
  License-Expression: BSD-3-Clause
@@ -28,7 +28,7 @@ Requires-Dist: mkdocs; extra == "dev"
28
28
  Requires-Dist: mkdocs-material; extra == "dev"
29
29
  Requires-Dist: beautifulsoup4; extra == "dev"
30
30
  Requires-Dist: mkdocstrings[python]; extra == "dev"
31
- Requires-Dist: pytest<9,>=8; extra == "dev"
31
+ Requires-Dist: pytest<10,>=9; extra == "dev"
32
32
  Dynamic: license-file
33
33
 
34
34
  # adeploy
@@ -1,4 +1,5 @@
1
1
  import json
2
+
2
3
  from bs4 import BeautifulSoup
3
4
 
4
5
 
@@ -1,12 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import re
4
+ from re import Match
4
5
 
5
6
  from mkdocs.config.defaults import MkDocsConfig
6
7
  from mkdocs.structure.files import Files
7
8
  from mkdocs.structure.pages import Page
8
- from re import Match
9
-
10
9
 
11
10
  # -----------------------------------------------------------------------------
12
11
  # Hooks
@@ -27,7 +26,9 @@ def on_page_markdown(markdown: str, *, page: Page, config: MkDocsConfig, files:
27
26
  raise RuntimeError(f"Unknown shortcode: {type}")
28
27
 
29
28
  # Find and replace all external asset URLs in current page
30
- return re.sub(r"<!-- md:(\w+)(.*?) -->", replace, markdown, flags=re.I | re.M)
29
+ return re.sub(
30
+ r"<!-- md:(\w+)(.*?) -->", replace, markdown, flags=re.IGNORECASE | re.MULTILINE
31
+ )
31
32
 
32
33
 
33
34
  # Create badge for version
@@ -55,7 +55,7 @@ dev = [
55
55
  "mkdocs-material",
56
56
  "beautifulsoup4",
57
57
  "mkdocstrings[python]",
58
- "pytest>=8,<9"
58
+ "pytest>=9,<10"
59
59
  ]
60
60
 
61
61
  [tool.ruff.lint]
@@ -0,0 +1,3 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json"
3
+ }
@@ -11,7 +11,6 @@ __unknown_args: argparse.Namespace
11
11
 
12
12
 
13
13
  def get_args():
14
- global __args
15
14
  return __args
16
15
 
17
16
 
@@ -1,4 +1,4 @@
1
- from colorama import Style, Fore
1
+ from colorama import Fore, Style
2
2
 
3
3
  _skip_colors = False
4
4
 
@@ -7,10 +7,11 @@ import yaml
7
7
  from yaml.parser import ParserError
8
8
  from yaml.scanner import ScannerError
9
9
 
10
+ from adeploy.common import colors
10
11
  from adeploy.common.errors import Error
11
12
  from adeploy.common.helpers import dict_update_recursive, get_defaults
12
- from adeploy.common.jinja import env as jinja_env, dict as jinja_dict
13
- from adeploy.common import colors
13
+ from adeploy.common.jinja import dict as jinja_dict
14
+ from adeploy.common.jinja import env as jinja_env
14
15
  from adeploy.common.secrets_provider.provider import SecretsProvider
15
16
 
16
17
 
@@ -55,20 +56,19 @@ class Deployment:
55
56
  [t[0] for t in args.filters_release] if args.filters_release else None
56
57
  )
57
58
 
58
- if (filters_namespace and self.namespace not in filters_namespace) or (
59
- filters_release
59
+ return bool(
60
+ filters_namespace
61
+ and self.namespace not in filters_namespace
62
+ or filters_release
60
63
  and self.name not in filters_release
61
64
  and self.release not in filters_release
62
- ):
63
- return True
64
-
65
- return False
65
+ )
66
66
 
67
67
  def load_config(
68
68
  self,
69
69
  config_path: Path | list[Path],
70
- defaults_files: list = None,
71
- log: Logger = None,
70
+ defaults_files: list | None = None,
71
+ log: Logger | None = None,
72
72
  ):
73
73
  # We're not yet rendering.
74
74
  # Reset list of known secrets in order to allow multiple deployments to use the same defaults file
@@ -1,38 +1,26 @@
1
1
  class Error(Exception):
2
2
  """Base class for exceptions in this module."""
3
3
 
4
- pass
5
-
6
4
 
7
5
  class InputError(Error):
8
6
  """Exception raised for errors in the user input."""
9
7
 
10
- pass
11
-
12
8
 
13
9
  class RenderError(Error):
14
10
  """Exception raised for errors in the renderer."""
15
11
 
16
- pass
17
-
18
12
 
19
13
  class TestError(Error):
20
14
  """Exception raised for errors in the tester."""
21
15
 
22
- pass
23
-
24
16
 
25
17
  class DeployError(Error):
26
18
  """Exception raised for errors in the tester."""
27
19
 
28
- pass
29
-
30
20
 
31
21
  class WrongClusterError(Error):
32
22
  """Exception raised if wrong cluster is targeted."""
33
23
 
34
- pass
35
-
36
24
 
37
25
  if __name__ == "__main__":
38
26
  pass
@@ -3,15 +3,16 @@ import logging
3
3
  import os
4
4
  import pkgutil
5
5
  import subprocess
6
+ from collections import namedtuple
6
7
  from pathlib import PosixPath
7
8
 
8
9
  import yaml
9
10
 
10
- from collections import namedtuple
11
+ import adeploy.common.jinja.env as jinja_env
11
12
  from adeploy import providers
13
+ from adeploy.common import colors
12
14
 
13
- import adeploy.common.colors as colors
14
- import adeploy.common.jinja.env as jinja_env
15
+ _log = logging.getLogger(__name__)
15
16
 
16
17
 
17
18
  def get_submodules(pkg):
@@ -21,9 +22,7 @@ def get_submodules(pkg):
21
22
  ):
22
23
  module_spec = module_finder.find_spec(name)
23
24
  module = module_spec.loader.load_module()
24
- class_name = list(filter(lambda m: module.__name__ == m.lower(), dir(module)))[
25
- 0
26
- ]
25
+ class_name = next(filter(lambda m: module.__name__ == m.lower(), dir(module)))
27
26
  modules.append((module, class_name))
28
27
 
29
28
  return modules
@@ -42,10 +41,10 @@ def get_providers() -> dict:
42
41
  module_spec = module_finder.find_spec(name)
43
42
  module = module_spec.loader.load_module()
44
43
  found[name] = namedtuple("Provider", "renderer tester deployer watcher")(
45
- renderer=getattr(module, "Renderer"),
46
- tester=getattr(module, "Tester"),
47
- deployer=getattr(module, "Deployer"),
48
- watcher=getattr(module, "Watcher"),
44
+ renderer=module.Renderer,
45
+ tester=module.Tester,
46
+ deployer=module.Deployer,
47
+ watcher=module.Watcher,
49
48
  )
50
49
  return found
51
50
 
@@ -62,7 +61,7 @@ def get_defaults(
62
61
  files = defaults_files
63
62
  defaults = {}
64
63
  for file in files:
65
- logging.debug(f"Loading defaults from {file}")
64
+ _log.debug(f"Loading defaults from {file}")
66
65
  env = jinja_env.create([file.parent], deployment=deployment, log=log)
67
66
  # Make best to load defaults
68
67
  template_values_default = {
@@ -83,7 +82,7 @@ def run_command(log, cmd) -> subprocess.CompletedProcess:
83
82
  # Convert possible Paths to strings
84
83
  cmd = [str(c) for c in cmd]
85
84
  log.debug(f"Executing command {colors.bold(' '.join(cmd))}")
86
- result = subprocess.run(cmd, capture_output=True, text=True)
85
+ result = subprocess.run(cmd, capture_output=True, text=True, check=False)
87
86
  result.check_returncode()
88
87
  return result
89
88
 
@@ -93,7 +92,7 @@ def dict_update_recursive(d: dict, u: dict) -> dict:
93
92
  for k, v in u.items():
94
93
  if isinstance(v, collections.abc.Mapping):
95
94
  sub = {}
96
- if d and k in d and d[k] and len(d[k]) > 0:
95
+ if d and k in d and isinstance(d[k], collections.abc.Mapping):
97
96
  sub = d[k]
98
97
  d[k] = dict_update_recursive(sub, v)
99
98
  # We don't merge lists! List will be overwritten completely.
@@ -4,7 +4,7 @@ import re
4
4
  class JinjaDict(dict):
5
5
  delimiter = None
6
6
 
7
- def __init__(self, dict, delimiter: str = None):
7
+ def __init__(self, dict, delimiter: str | None = None):
8
8
  super().__init__(dict)
9
9
  if delimiter:
10
10
  self.delimiter = re.compile(delimiter)
@@ -1,17 +1,15 @@
1
- from inspect import getmembers, isfunction, ismethod, getfile
1
+ from inspect import getfile, getmembers, isfunction, ismethod
2
2
  from logging import Logger
3
3
  from pathlib import Path
4
- from typing import List
5
4
 
6
5
  import jinja2
7
6
 
8
- import adeploy.common.jinja.globals as globals
9
- import adeploy.common.jinja.filters as filters
7
+ from adeploy.common.jinja import filters, globals
10
8
 
11
9
 
12
10
  def create(
13
- pathes: List[str or Path] = None,
14
- log: Logger = None,
11
+ pathes: list[str or Path] | None = None,
12
+ log: Logger | None = None,
15
13
  deployment=None,
16
14
  templates_dir=None,
17
15
  ) -> jinja2.Environment:
@@ -35,7 +33,10 @@ def create(
35
33
 
36
34
 
37
35
  def register_globals(
38
- env: jinja2.Environment, deployment=None, log: Logger = None, templates_dir=None
36
+ env: jinja2.Environment,
37
+ deployment=None,
38
+ log: Logger | None = None,
39
+ templates_dir=None,
39
40
  ):
40
41
  handler = globals.Handler(env, deployment, log, templates_dir)
41
42
  for name, method in getmembers(handler, predicate=ismethod):
@@ -45,7 +46,7 @@ def register_globals(
45
46
  if log:
46
47
  log.debug(
47
48
  f'Registering global function "{name}" '
48
- + (f'for deployment "{str(deployment)}" ' if deployment else "")
49
+ + (f'for deployment "{deployment!s}" ' if deployment else "")
49
50
  + f'from "{getfile(method)}"'
50
51
  )
51
52
 
@@ -59,7 +60,7 @@ def register_globals(
59
60
  if log:
60
61
  log.debug(
61
62
  f'Registering global function "{name}" '
62
- + (f'for deployment "{str(deployment)}" ' if deployment else "")
63
+ + (f'for deployment "{deployment!s}" ' if deployment else "")
63
64
  + f'from "{getfile(func_creator)}"'
64
65
  )
65
66
 
@@ -1,13 +1,13 @@
1
1
  import base64
2
2
  import hashlib
3
3
  from pathlib import Path
4
- from typing import Union
5
4
 
6
5
  import yaml as _yaml
6
+
7
7
  import adeploy.common.jinja.dict as jinja_dict
8
8
 
9
9
 
10
- def yaml(obj: Union[jinja_dict.JinjaDict, dict], flow_style: bool) -> str:
10
+ def yaml(obj: jinja_dict.JinjaDict | dict, flow_style: bool) -> str:
11
11
  """Converts given object into YAML formatted string
12
12
 
13
13
  This filter is using [PyYAML](https://pyyaml.org/wiki/PyYAMLDocumentation) to convert the given object into a
@@ -3,37 +3,36 @@ The following functions are globally available in the `default.yml`, the namespa
3
3
  in the Jinja templates in your `templates` folder.
4
4
  """
5
5
 
6
+ import json
6
7
  import os
7
8
  import pathlib
8
- import sys
9
- import uuid
10
- import shortuuid
11
- import jq
12
9
  import string
13
- import json
10
+ import sys
14
11
  import textwrap
15
12
  import urllib.request
16
- import jinja2
17
-
13
+ import uuid
18
14
  from logging import Logger
19
- from typing import Dict, List, Literal, Union
15
+ from typing import ClassVar, Literal, Union
16
+
17
+ import jinja2
18
+ import jq
19
+ import shortuuid
20
20
  from ruamel.yaml import YAML
21
21
 
22
- import adeploy.common.colors as colors
23
22
  import adeploy.common.secrets as secret
24
- import adeploy.common.errors as errors
23
+ from adeploy.common import colors, errors
25
24
  from adeploy.common.secrets_provider.provider import SecretsProvider
26
25
 
27
26
 
28
- class Handler(object):
29
- named_passwords = {}
27
+ class Handler:
28
+ named_passwords: ClassVar[dict] = {}
30
29
 
31
30
  def __init__(
32
31
  self,
33
32
  env: jinja2.Environment,
34
33
  deployment=None,
35
- log: Logger = None,
36
- templates_dir: str = None,
34
+ log: Logger | None = None,
35
+ templates_dir: str | None = None,
37
36
  ):
38
37
  self.env = env
39
38
  self.deployment = deployment
@@ -43,9 +42,9 @@ class Handler(object):
43
42
  def from_json_or_yaml(
44
43
  self,
45
44
  path: str,
46
- jq_query: str = None,
47
- force_type: Literal["json", "yaml"] = None,
48
- ) -> Union[dict, str, list]:
45
+ jq_query: str | None = None,
46
+ force_type: Literal["json", "yaml"] | None = None,
47
+ ) -> dict | str | list:
49
48
  """Include data from an external JSON or YAML file in your defaults.yml or namespace / release configuration.
50
49
  Optionally apply a jq query. Useful if a var is not in the `defaults.yml` or in the namespace / release
51
50
  configuration but in an external file - for example an ansible hostvars file.
@@ -127,7 +126,7 @@ class Handler(object):
127
126
  # Apply jq-like query to the data
128
127
  try:
129
128
  results = jq.all(jq_query, data) # Get all matches
130
- except Exception as e:
129
+ except Exception as e: # noqa: BLE001
131
130
  self.log.error(f"Error applying query: {jq_query}. Error: {e}")
132
131
  sys.exit(1)
133
132
 
@@ -206,13 +205,13 @@ class Handler(object):
206
205
 
207
206
  def create_labels(
208
207
  self,
209
- name: str = None,
210
- instance: str = None,
211
- version: str = None,
212
- component: str = None,
213
- part_of: str = None,
208
+ name: str | None = None,
209
+ instance: str | None = None,
210
+ version: str | None = None,
211
+ component: str | None = None,
212
+ part_of: str | None = None,
214
213
  managed_by: str = "adeploy",
215
- labels: Union[dict, list] = None,
214
+ labels: dict | list | None = None,
216
215
  **kwargs: dict,
217
216
  ) -> str:
218
217
  """Creates a dict of custom and common labels
@@ -289,8 +288,8 @@ class Handler(object):
289
288
  direct: bool = False,
290
289
  render: bool = True,
291
290
  indent: int = 4,
292
- skip: List[str] = None,
293
- escape: List[str] = None,
291
+ skip: list[str] | None = None,
292
+ escape: list[str] | None = None,
294
293
  ) -> str:
295
294
  """Include and optionally render arbitrary files into your manifest
296
295
 
@@ -410,8 +409,8 @@ class Handler(object):
410
409
  direct: bool = False,
411
410
  render: bool = True,
412
411
  indent: int = 4,
413
- skip: List[str] = None,
414
- escape: List[str] = None,
412
+ skip: list[str] | None = None,
413
+ escape: list[str] | None = None,
415
414
  ) -> dict:
416
415
  """Include files from a directory
417
416
 
@@ -455,13 +454,13 @@ class Handler(object):
455
454
 
456
455
  def create_secret(
457
456
  self,
458
- name: str = None,
457
+ name: str | None = None,
459
458
  use_pass: bool = True,
460
459
  use_gopass_cat: bool = True,
461
460
  custom_cmd: bool = False,
462
461
  as_ref: bool = False,
463
- data: dict = None,
464
- **kwargs: Dict[str, "SecretsProvider"],
462
+ data: dict | None = None,
463
+ **kwargs: dict[str, "SecretsProvider"],
465
464
  ) -> str:
466
465
  """Creates k8s secrets
467
466
 
@@ -574,13 +573,13 @@ class Handler(object):
574
573
  "You must specify at least a secret key if using create_secret() with key_ref = True"
575
574
  )
576
575
 
577
- return json.dumps({"name": s.name, "key": list(keys)[0]})
576
+ return json.dumps({"name": s.name, "key": next(iter(keys))})
578
577
 
579
578
  def create_tls_secret(
580
579
  self,
581
580
  cert: Union[str, "SecretsProvider"],
582
581
  key: Union[str, "SecretsProvider"],
583
- name: str = None,
582
+ name: str | None = None,
584
583
  use_pass: bool = True,
585
584
  use_gopass_cat: bool = True,
586
585
  custom_cmd: bool = False,
@@ -646,8 +645,8 @@ class Handler(object):
646
645
  server: str,
647
646
  username: str,
648
647
  password: Union["SecretsProvider", str],
649
- email: str = None,
650
- name: str = None,
648
+ email: str | None = None,
649
+ name: str | None = None,
651
650
  use_pass: bool = True,
652
651
  use_gopass_cat: bool = True,
653
652
  custom_cmd: bool = False,
@@ -1,11 +1,10 @@
1
1
  import json
2
2
  import os
3
+ import random
3
4
  import string
4
5
  import subprocess
5
6
  import tempfile
6
- import random
7
7
  from logging import Logger
8
- from typing import Optional
9
8
 
10
9
  import yaml
11
10
 
@@ -102,9 +101,9 @@ def kubectl_create_secret(
102
101
  namespace,
103
102
  type,
104
103
  args,
105
- labels: dict = None,
106
- dry_run: bool = None,
107
- output: str = None,
104
+ labels: dict | None = None,
105
+ dry_run: bool | None = None,
106
+ output: str | None = None,
108
107
  ) -> subprocess.CompletedProcess:
109
108
  # Get manifest for secret
110
109
  result = kubectl(
@@ -117,7 +116,7 @@ def kubectl_create_secret(
117
116
  # Add labels
118
117
  manifest = dict_update_recursive(manifest, {"metadata": {"labels": labels}})
119
118
 
120
- fd = tempfile.NamedTemporaryFile(delete=False, mode="w")
119
+ fd = tempfile.NamedTemporaryFile(delete=False, mode="w") # noqa: SIM115
121
120
  yaml.dump(manifest, fd)
122
121
  fd.close()
123
122
 
@@ -138,7 +137,7 @@ def kubectl_create_secret(
138
137
 
139
138
 
140
139
  def kubectl(
141
- log: Logger, args: list, namespace: str = None
140
+ log: Logger, args: list, namespace: str | None = None
142
141
  ) -> subprocess.CompletedProcess:
143
142
  cmd = ["kubectl", "--kubeconfig", str(KUBECONF)]
144
143
  if namespace:
@@ -146,7 +145,7 @@ def kubectl(
146
145
  cmd += args
147
146
 
148
147
  log.debug(f"Executing command {colors.bold(' '.join(cmd))}")
149
- result = subprocess.run(cmd, capture_output=True, text=True)
148
+ result = subprocess.run(cmd, capture_output=True, text=True, check=False)
150
149
  result.check_returncode()
151
150
  return result
152
151
 
@@ -159,7 +158,10 @@ def kubectl_init(args):
159
158
  KUBECONF.parent.mkdir(parents=True, exist_ok=True)
160
159
 
161
160
  result = subprocess.run(
162
- ["kubectl", "config", "view", "--raw"], capture_output=True, text=True
161
+ ["kubectl", "config", "view", "--raw"],
162
+ capture_output=True,
163
+ text=True,
164
+ check=False,
163
165
  )
164
166
  result.check_returncode()
165
167
 
@@ -170,10 +172,10 @@ def kubectl_init(args):
170
172
  def parse_kubectrl_apply(
171
173
  log,
172
174
  stdout,
173
- manifests: dict = None,
174
- fake_ns: str = None,
175
- default_ns: str = None,
176
- deployment_ns: str = None,
175
+ manifests: dict | None = None,
176
+ fake_ns: str | None = None,
177
+ default_ns: str | None = None,
178
+ deployment_ns: str | None = None,
177
179
  prefix="...",
178
180
  ):
179
181
  # If there is no fake_ns, we need to determine by comparing existing namespaces
@@ -244,7 +246,7 @@ def parse_kubectrl_apply(
244
246
  )
245
247
 
246
248
 
247
- def kubectl_get_current_api_server_url(log: Logger) -> Optional[str]:
249
+ def kubectl_get_current_api_server_url(log: Logger) -> str | None:
248
250
  args = [
249
251
  "config",
250
252
  "view",
@@ -22,7 +22,7 @@ def setup(args):
22
22
  logging.getLogger("requests").setLevel(logging.WARNING)
23
23
 
24
24
 
25
- def get_logger(name: str = None):
25
+ def get_logger(name: str | None = None):
26
26
  return logging.getLogger(name)
27
27
 
28
28
 
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
5
5
  from argparse import Namespace
6
6
  from logging import Logger
7
7
  from pathlib import Path
8
- from typing import Optional
8
+ from typing import ClassVar
9
9
 
10
10
  from packaging.version import parse as parse_version
11
11
 
@@ -25,7 +25,7 @@ class Provider(ABC):
25
25
  log: Logger = None
26
26
  args: Namespace = None
27
27
 
28
- extensions: list = ["yml", "yaml"]
28
+ extensions: ClassVar[list] = ["yml", "yaml"]
29
29
 
30
30
  def __init__(
31
31
  self,
@@ -73,11 +73,9 @@ class Provider(ABC):
73
73
  paths.append(path)
74
74
  return paths
75
75
 
76
- def get_defaults_file(self) -> Optional[Path]:
77
- if self.defaults_path.exists():
78
- # <defaults_path>
79
- if self.defaults_path.is_file():
80
- return self.defaults_path
76
+ def get_defaults_file(self) -> Path | None:
77
+ if self.defaults_path.exists() and self.defaults_path.is_file():
78
+ return self.defaults_path
81
79
 
82
80
  defaults_path = (
83
81
  self.defaults_path
@@ -1,6 +1,6 @@
1
- from .secret import Secret
1
+ from .docker_registry_secret import DockerRegistrySecret
2
2
  from .generic_secret import GenericSecret
3
+ from .secret import Secret
3
4
  from .tls_secret import TlsSecret
4
- from .docker_registry_secret import DockerRegistrySecret
5
5
 
6
- __all__ = ["Secret", "GenericSecret", "TlsSecret", "DockerRegistrySecret"]
6
+ __all__ = ["DockerRegistrySecret", "GenericSecret", "Secret", "TlsSecret"]
@@ -1,6 +1,5 @@
1
1
  import subprocess
2
2
  from logging import Logger
3
- from typing import Union
4
3
 
5
4
  from adeploy.common.kubectl import kubectl_create_secret
6
5
  from adeploy.common.secrets.secret import Secret
@@ -19,9 +18,9 @@ class DockerRegistrySecret(Secret):
19
18
  deployment,
20
19
  server: str,
21
20
  username: str,
22
- password: Union[SecretsProvider, str],
23
- email: str = None,
24
- name: str = None,
21
+ password: SecretsProvider | str,
22
+ email: str | None = None,
23
+ name: str | None = None,
25
24
  use_pass: bool = True,
26
25
  use_gopass_cat: bool = True,
27
26
  custom_cmd: bool = False,
@@ -36,7 +35,10 @@ class DockerRegistrySecret(Secret):
36
35
  return not isinstance(self.password, SecretsProvider)
37
36
 
38
37
  def create(
39
- self, log: Logger = None, dry_run: str = None, output: str = None
38
+ self,
39
+ log: Logger | None = None,
40
+ dry_run: str | None = None,
41
+ output: str | None = None,
40
42
  ) -> subprocess.CompletedProcess:
41
43
  args = [f"--docker-server={self.server}", f"--docker-username={self.username}"]
42
44