Get chaged Kustomize overlays
When managing multiple applications across multiple clusters in a GitOps approach with kustomize there are a lot of overlays to test.
Kustomize doesn't even provide log output of it's transformations, this tool recursively calculates the dependencies of a given overlay and compares them with the files changed by a merge request, returning only those kustomize overlays that were affected by a merge request.
This tool does not check the validity of your kustomizations beyond resolving the paths of the dependencies, for proper linting use
oc apply --dry-run=server -for kubeconform.
Usage
usage: main.py [-h] --changed-files CHANGED_FILES [CHANGED_FILES ...] --base-overlays BASE_OVERLAYS [BASE_OVERLAYS ...] [-o OUTPUT_FILE]
optional arguments:
-h, --help show this help message and exit
--changed-files CHANGED_FILES [CHANGED_FILES ...]
The files that were changed
--base-overlays BASE_OVERLAYS [BASE_OVERLAYS ...]
The base overlays potentially affected
-o OUTPUT_FILE, --output-file OUTPUT_FILE
The output file path
Example
Manually
python -m get-changed-kustomize-overlays --changed-files folder1/file1.yaml folder2/file2.yaml --base-overlays folder1/kustomization.yaml folder2/kustomization.yaml
GitLab CI
OVERLAYS=$(find . -regex '.*/overlays/[a-z]*/kustomization.yaml' | tr '\n' ' ')
CHANGED_FILES=$(git diff --name-only $CI_MERGE_REQUEST_TARGET_BRANCH_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA | tr '\n' ' ')
python -m get-changed-kustomize-overlays --changed-files $(echo $CHANGED_FILES) --base-overlays $(echo $OVERLAYS)
External dependencies
It is not possible to check for changes in external dependencies in CI pipelines that are triggered by merge requests, you should use tags or SHAs to signify changes in external dependencies.
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://github.com/ORGANIZATION/REPOSITORY.git//PATH_INSIDE_REPO?ref=<TAG/SHA>
Release files for get-changed-kustomize-overlays 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| get_changed_kustomize_overlays-0.1.3.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| get_changed_kustomize_overlays-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / get_changed_kustomize_overlays-0.1.3.tar.gz
| Download URL | get_changed_kustomize_overlays-0.1.3.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51bdb254ca9ef77aa87607ffc3a43d81c364bb509e443b2e425dabf99313e072
|
|
BLAKE2b-256 checksum How to use checksums |
22d8bd1d9bbc13279933470aed809e23fd45e9c8c02fd5122927d4381a411c47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Release files / get_changed_kustomize_overlays-0.1.3-py3-none-any.whl
| Download URL | get_changed_kustomize_overlays-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
434642007d662971684974d7400a20d36bbe114d18f61c39a2d8ffa3144a99a1
|
|
BLAKE2b-256 checksum How to use checksums |
87dedbc40eb6fb455c42a596f6a8e343d76fd509342b39c1b68f89e169014b8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|