flant / addon-operator

A system to manage additional components for Kubernetes cluster in a simple, consistent and automated way.
https://flant.github.io/addon-operator/
Apache License 2.0
483 stars 27 forks source link

Add the ability to see diff between revisions #401

Open nabokihms opened 1 year ago

nabokihms commented 1 year ago

Problem

The main idea is that it is sometimes required to see what changes between module runs. For example, resources were redeployed because a value was changed, and you want to know why exactly this happened.

Proposal

Add the command to see module revisions.

module revision # lists all revisions
module revision 513 --manifests # shows manifests of the particular revision
module revision 513 --values # shows values of the particular revision

With this, the following scenarios are possible:

  1. Compare the current render with the previous revision:
diff -u <(module render) <(module revision 513 --manifests)
  1. Compare two previous revisions:

    diff -u <(module revision 513 --manifests) <(module revision 512 --manifests)
  2. Compare current values with the values from the previous revision:

    diff -u <(module values) <(module revision 513 --values)
  3. Compare values from two previous revisions:

    diff -u <(module revision 513 --values) <(module revision 512 --values)