nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Compare versions by name with nomad plan and nomad history

Open philrenaud opened this issue 1 year ago • 0 comments

  • Adds diff_tag and diff_version flags for the nomad job versions API endpoint, and for the nomad job plan and nomad job history commands.

  • Adds Tag info to nomad job history output

Usage:

(Prerequisite tag a version of your job with nomad job tag apply, per https://github.com/hashicorp/nomad/pull/23863)

Diff against a specific tag

nomad job plan -diff-tag=my-tag-name difftester.nomad.hcl

Diff against a specific version, whether tagged or not

nomad job plan -diff-version=2 difftester.nomad.hcl

See history including tag info, with diffs

(each version will show a diff to its predecessor, except for version 0 / first non-GC'd version, which has no known predecessor)

nomad job history -p difftester

See history with diffs against a specific tag

nomad job history -p -diff-tag=my-tag-name difftester

See history with diffs against a specific version, whether tagged or not

nomad job history -p -diff-version=2 difftester

Resolves #23879

TODO:

  • [ ] Tests

philrenaud avatar Aug 28 '24 18:08 philrenaud