Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.27 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.27 KB

msort

msort takes a list of kubernetes manifests as input and sorts them to produce a reproducible artifact.

Install

Please use go to download, compile and install the binary.

go get -u -v github.com/utopia-planitia/msort

Help

NAME:
   msort - sort yaml manifests

USAGE:
   msort [global options] command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --sort-keys     sort keys within each yaml document (default: false)
   --drop-tests    remove yaml documents with "test" in its name (default: false)
   --in-place, -i  update files in place (default: false)
   --help, -h      show help (default: false)

Example

Sort yaml documents within file.yaml by Kind, Name, and Namspace, then print the result to stdout.

msort --in-place --sort-keys file.yaml

Read file.yaml, sort by Kind, Name, and Namespace, then and sort maps by key and update the file.

msort --in-place --sort-keys file.yaml

Sort the output of helmfile template by Kind, Name, and Namespace, then remove kubernetes manifests with test in their name, then print to stdout and redirect to file.yaml.

helmfile template | msort --drop-tests > file.yaml