Helmfile: Only sync release if there is a difference

Created on 1 Aug 2018  路  11Comments  路  Source: roboll/helmfile

Any possibility of adding a feature to run the sync for releases in the helmfile that have differences.

With the feature of helm diff I would imagine this would be something that would fit?

feature request

All 11 comments

@kody-abe Hey! Thanks for the request.

Would you mind clarifying a bit more, on pros of your requested feature over just helmfile diff && helmfile sync?

@mumoshu I guess maybe the terraform style.

Showing all the changes and then asking for confirmation.

Currently, our team will just have a policy to run the diff first verify the changes are as expected and then run sync.

I can see the value in having sync, or another command, run the diff and present it if changes are found, then ask if the command should continue with sync.

One pro of only doing the updates is not upgrading every release in the helmfile. If you had a automated system that ran on say a 5 min interval you would end up with thousands of releases, but if it only upgraded on releases that changed it would work cleanly.

@kody-abe Thanks for the clarification! Just to make it extra clear, you're talking about non-CI use-case, that is, helmfile is run by humans so interactive confirmation makes sense, right?

@mumoshu Correct!

@sstarcher Good point! It would be a good enhancement. Just a moment until I come up with something...

@sstarcher @kody-abe How about adding helmfile apply, that runs helmfile diff and then helmfile sync only when there's any change?

I'm introducing a brand-new command to retain backward-compatibility while giving more terraform-like u/x to helmfile with (from my perspective) a more appropriate name.

// Regarding the last point, I remember that I had once felt a bit ambiguity in the "direction" of helmfile sync. That is either helmfile is synchronized to the cluster, or the cluster is synchronized to helmfile. apply doesn't have such ambiguity imo.

helmfile apply will, by default, prompt the user for confirmation before running helmfile sync. The confirmation can be skipped by providing a flag named like --auto-approve or --force(Which one do you prefer by the way? The former is from terraform, while the latter is a more widely used flag I think).

@mumoshu Yes, apply sounds like a great route. Very good for making it backwards compatible. As for the flag I don't have a preference either way. Thanks for this!

@kody-abe Thanks a lot for the confirmations 馃憤

Sounds good to me, I'm good with either, but due to it seems people being familiar with terraform I would lean toward -auto-approve. Other prior art would be -y for yes and --force of course.

Just submitted #263 for this. I've proceeded with --auto-approve according to your feedback.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willejs picture willejs  路  4Comments

pavdmyt picture pavdmyt  路  3Comments

klebediev picture klebediev  路  3Comments

michaelpporter picture michaelpporter  路  3Comments

cilerler picture cilerler  路  3Comments