Crates.io | yabe-gitops |
lib.rs | yabe-gitops |
version | 0.1.2 |
source | src |
created_at | 2024-10-05 17:29:38.041712 |
updated_at | 2024-10-05 17:29:38.041712 |
description | GitOps organizer |
homepage | |
repository | https://github.com/dvrkn/yabe |
max_upload_size | |
id | 1398316 |
size | 62,961 |
The idea comes from the need to manage huge amount of YAML files in a GitOps environment. Especially when using ArgoCD multi-source apps with some common values and some overrides. The tool helps to compute the common base configuration among multiple YAML files and generate differences for each file, reducing the duplication of configuration values. It also provides the ability to sort YAML content based on user-defined configuration.
Usage: yabe [OPTIONS] <INPUT_FILES>...
Arguments:
<INPUT_FILES>... Input YAML files
Options:
-r, --read-base <READ_BASE> (Optional) Read-only base for values deduplication
-b, --base <WRITE_BASE> (Optional) Common values of all input files, if not provided, will be computed
-i, --in-place Modify the original input files with diffs
-o, --out <OUT_FOLDER> Output folder for diff files [default: ./out]
--debug Enable debug logging
-q, --quorum <QUORUM> Quorum percentage (0-100) [default: 51]
--base-out-path <BASE_OUT_PATH> (Optional) Base file output path [default: ./base.yaml]
--sort-config-path <SORT_CONFIG_PATH> (Optional) Sort configuration file path [default: ./sort-config.yaml], if not provided, will not sort
-h, --help Print help
-V, --version Print version
Run the tool with the YAML override files:
./yabe file1.yaml file2.yaml file3.yaml
This will compute the differences among the override files and generate:
Use the -i or --inplace flag to modify the original override files with their differences:
./yabe -i -r helm_values.yaml file1.yaml file2.yaml file3.yaml
Use the --debug flag to enable detailed debug logging:
./yabe --debug -r helm_values.yaml file1.yaml file2.yaml file3.yaml
helm_values.yaml
settings:
theme: dark
notifications: true
advanced:
mode: auto
level: 5
file1.yaml
settings:
theme: dark
notifications: true
advanced:
mode: auto
level: 5
file2.yaml
settings:
theme: light
notifications: true
advanced:
mode: manual
level: 5
file3.yaml
settings:
theme: dark
notifications: false
advanced:
mode: auto
level: 7
./yabe -r helm_values.yaml file1.yaml file2.yaml file3.yaml
base.yaml
settings:
advanced:
level: 5
file1_diff.yaml (Empty file or not generated since there are no differences)
file2_diff.yaml
settings:
theme: light
advanced:
mode: manual
file3_diff.yaml
settings:
notifications: false
advanced:
level: 7
Running with the -i flag:
./yabe -i -r helm_values.yaml file1.yaml file2.yaml file3.yaml
The project includes a suite of tests to verify functionality. To run the tests:
cargo test
Ensure all tests pass to verify that the tool is functioning correctly.