adeploy 1.3.3__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.
- {adeploy-1.3.3 → adeploy-1.3.4}/.gitignore +1 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/PKG-INFO +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/hooks/asciinema.py +1 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/hooks/badges.py +4 -3
- {adeploy-1.3.3 → adeploy-1.3.4}/pyproject.toml +1 -1
- adeploy-1.3.4/renovate.json +3 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/args.py +0 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/colors.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/deployment.py +10 -10
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/errors.py +0 -12
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/helpers.py +11 -12
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/jinja/dict.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/jinja/env.py +10 -9
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/jinja/filters.py +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/jinja/globals.py +34 -35
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/kubectl.py +16 -14
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/logging.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/provider.py +5 -7
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets/__init__.py +3 -3
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets/docker_registry_secret.py +7 -5
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets/generic_secret.py +7 -5
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets/secret.py +22 -20
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets/tls_secret.py +9 -7
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/gopass_provider.py +8 -10
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/plaintext_provider.py +0 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/provider.py +2 -4
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/random_provider.py +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/shell_command_provider.py +3 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/version.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/find.py +3 -7
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/labels.py +1 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/probes.py +2 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/resources.py +1 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/update.py +2 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/main.py +7 -10
- {adeploy-1.3.3/src/adeploy/providers/jinja → adeploy-1.3.4/src/adeploy/providers/helm}/__init__.py +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/common/__init__.py +11 -10
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/renderer.py +9 -4
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/tester.py +3 -4
- {adeploy-1.3.3/src/adeploy/providers/helm → adeploy-1.3.4/src/adeploy/providers/jinja}/__init__.py +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/jinja/deployer.py +1 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/jinja/renderer.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/jinja/tester.py +2 -3
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/jinja/watcher.py +5 -3
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/__init__.py +4 -4
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/config.py +1 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/PKG-INFO +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/SOURCES.txt +1 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/requires.txt +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/scm_file_list.json +214 -213
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/scm_version.json +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/uv.lock +5 -5
- {adeploy-1.3.3 → adeploy-1.3.4}/.awesome.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/.gitlab-ci.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/DEVELOP.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/LICENSE +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/css/asciinema-player.css +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/css/badges.css +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/css/docstrings.css +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/css/footer.css +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/download.sh +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/img/awesome-logo.png +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/js/asciinema-init.js +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/assets/js/asciinema-player.min.js +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/_more.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/filters.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/functions.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/includes.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/index.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/labels.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/macros.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/probes.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/resource-limits.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/common/secrets.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm/helm-deploy.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm/helm-render.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm/helm-test.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm/hooks.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm/index.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/helm.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/index.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/install.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/jinja/index.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/jinja/jinja-deploy.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/jinja/jinja-render.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/jinja/jinja-test.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/jinja.cast +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/overrides/partials/copyright.html +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/docs/usage.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/.exclude-from-test +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/.helmignore +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/Chart.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/service.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/charts/hello-world/values.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/prod/manifest.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/prod/values.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/manifest.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/build/helm/playground/hello-world/test/values.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/prod/000-common.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/prod/010-service-account.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/001-quickstart/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/.helmignore +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/Chart.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/NOTES.txt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/_helpers.tpl +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/deployment.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/service.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/templates/serviceaccount.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/charts/hello-world/values.yaml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/playground/hello-world/test/manifest.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/build/helm/playground/hello-world/test/values.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/hooks/patch.sh +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/hooks/patches.d/001-add-env.patch +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/helm/002-hooks/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/.exclude-from-test +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/prod/job.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/build/jinja/playground/001-general-structure/test/job.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/prod/000-common.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/prod/010-nginx.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/templates/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/001-general-structure/templates/job.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/002-secrets/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/prod/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/build/jinja/playground/002-secrets/test/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_prod +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/secrets/my_secret_test +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets/templates/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-6e1adb2c4c075e35335e851dd6ebc5f0f7397a80 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-7e33ba97416ba4d45b6ce4c6c68b6aace36eacc5 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/prod/secret-e5e0c551a537d65bcea7c18eb47badaf9c09c349 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-7929a442fae0ceee9eef9558a9a2ef02cc9d4421 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-dcf2a6e7bd78ee395f73f6434b19a9044790c00a +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/002-secrets-ingress/secrets/playground/test/secret-f310a9ad786b3fb5f7160436346e69795693b951 +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/prod/ingress.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/build/jinja/playground/002-secrets-ingress/test/ingress.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.crt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_prod/mydomain.com.key +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.crt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/domain_test/mydomain.com.key +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_prod +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/secrets/my_secret_test +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/templates/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/002-secrets-ingress/templates/ingress.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/common/configmap.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/common/configmap.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/build/jinja/playground/003-include/test/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/__affinity.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/__env.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/common/configmap.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/conf.d/alpha.json +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/conf.d/beta.json +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/files/nginx.conf +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/003-include/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/build/jinja/playground/004-probes/test/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/004-probes/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/build/jinja/playground/005-labels/prod/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/build/jinja/playground/005-labels/test/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/005-labels/templates/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/prod/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/build/jinja/playground/006-nested-labels/test/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/006-nested-labels/templates/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/prod/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/build/jinja/playground/007-resources/test/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/defaults.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/namespaces/playground/prod.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/namespaces/playground/test.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/templates/nginx/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/examples/jinja/007-resources/templates/redis/deployment.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/mkdocs.yml +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/setup.cfg +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/__main__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/jinja/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/secrets_provider/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/common/yaml/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/__init__.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm.py +2 -2
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm_output.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/common/helm_provider.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/deployer.py +1 -1
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/helm/watcher.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/providers/jinja/README.md +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/deploy.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/render.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/test.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy/steps/watch.py +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/dependency_links.txt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/entry_points.txt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/src/adeploy.egg-info/top_level.txt +0 -0
- {adeploy-1.3.3 → adeploy-1.3.4}/tests/test_release_fragments.py +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: adeploy
|
|
3
|
-
Version: 1.3.
|
|
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
|
|
31
|
+
Requires-Dist: pytest<10,>=9; extra == "dev"
|
|
32
32
|
Dynamic: license-file
|
|
33
33
|
|
|
34
34
|
# adeploy
|
|
@@ -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(
|
|
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
|
|
@@ -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
|
|
13
|
-
from adeploy.common import
|
|
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
|
-
|
|
59
|
-
|
|
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
|
-
|
|
11
|
+
import adeploy.common.jinja.env as jinja_env
|
|
11
12
|
from adeploy import providers
|
|
13
|
+
from adeploy.common import colors
|
|
12
14
|
|
|
13
|
-
|
|
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 =
|
|
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=
|
|
46
|
-
tester=
|
|
47
|
-
deployer=
|
|
48
|
-
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
|
-
|
|
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
|
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
from inspect import getmembers, isfunction, ismethod
|
|
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
|
-
|
|
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:
|
|
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,
|
|
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 "{
|
|
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 "{
|
|
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:
|
|
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
|
|
10
|
+
import sys
|
|
14
11
|
import textwrap
|
|
15
12
|
import urllib.request
|
|
16
|
-
import
|
|
17
|
-
|
|
13
|
+
import uuid
|
|
18
14
|
from logging import Logger
|
|
19
|
-
from typing import
|
|
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
|
-
|
|
23
|
+
from adeploy.common import colors, errors
|
|
25
24
|
from adeploy.common.secrets_provider.provider import SecretsProvider
|
|
26
25
|
|
|
27
26
|
|
|
28
|
-
class Handler
|
|
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
|
-
) ->
|
|
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:
|
|
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:
|
|
293
|
-
escape:
|
|
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:
|
|
414
|
-
escape:
|
|
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:
|
|
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":
|
|
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"],
|
|
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) ->
|
|
249
|
+
def kubectl_get_current_api_server_url(log: Logger) -> str | None:
|
|
248
250
|
args = [
|
|
249
251
|
"config",
|
|
250
252
|
"view",
|
|
@@ -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
|
|
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) ->
|
|
77
|
-
if self.defaults_path.exists():
|
|
78
|
-
|
|
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 .
|
|
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__ = ["
|
|
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:
|
|
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,
|
|
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
|
|