Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Print configuration diff to the user before "cluster apply" operation #1143

Open
invidian opened this issue Oct 29, 2020 · 2 comments
Open
Labels
kind/enhancement New feature or request

Comments

@invidian
Copy link
Member

Distilled from #142 (comment), we could take user configuration while lokoctl cluster apply runs and we could save it to the cluster as Secret object.

Then, on subsequent lokoctl cluster apply runs, we would pull the content of the secret and print user a diff in the configuration, so they can confirm it. This would include both cluster and components configuration. We could also store used lokoctl version there and/or Lokomotive version (when #312 gets implemented).

Some questions to answer before we implement it:

  • Should we use Kubernetes Secrets to store the configurations? Or maybe Terraform state?
  • What about the values files? Should we store them too? Or maybe we should evaluate the interpolation in the config and only store the result?
  • Do we want to save the configuration in HCL format or maybe e.g. YAML would work? YAML generated from HCL will be more predictable (won't produce diff when order of things changes) and will have all the values evaluated.
@johananl
Copy link
Member

Not sure it's 100% applicable but putting it here anyway: https://github.com/google/go-cmp could become useful for calculating diffs and formatting them.

@johananl
Copy link
Member

Actually -

It is intended to only be used in tests

So 🤷

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants