Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only sync release if there is a difference #205

Closed
kody-abe opened this issue Aug 1, 2018 · 11 comments
Closed

Only sync release if there is a difference #205

kody-abe opened this issue Aug 1, 2018 · 11 comments

Comments

@kody-abe
Copy link

kody-abe commented Aug 1, 2018

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?

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 6, 2018

@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?

@kody-abe
Copy link
Author

kody-abe commented Aug 6, 2018

@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.

@sstarcher
Copy link
Contributor

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.

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 20, 2018

@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?

@kody-abe
Copy link
Author

@mumoshu Correct!

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 20, 2018

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

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 20, 2018

@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).

@kody-abe
Copy link
Author

@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!

@mumoshu
Copy link
Collaborator

mumoshu commented Aug 20, 2018

@kody-abe Thanks a lot for the confirmations 👍

@sstarcher
Copy link
Contributor

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.

mumoshu added a commit to mumoshu/helmfile that referenced this issue Aug 30, 2018
This command syncs releases only if there is any difference between the desired and the current state. It asks for an confirmation by default. Provide `--auto-approve` flag after the `apply` command to skip it.

Resolves roboll#205
@mumoshu
Copy link
Collaborator

mumoshu commented Aug 30, 2018

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

mumoshu added a commit to mumoshu/helmfile that referenced this issue Aug 31, 2018
This command syncs releases only if there is any difference between the desired and the current state. It asks for an confirmation by default. Provide `--auto-approve` flag after the `apply` command to skip it.

Resolves roboll#205
mumoshu added a commit that referenced this issue Aug 31, 2018
This command syncs releases only if there is any difference between the desired and the current state. It asks for an confirmation by default. Provide `--auto-approve` flag after the `apply` command to skip it.

Resolves #205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants