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

Still attempt upgrades on non-deployed releases #958

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Secretions
Copy link

Currently, if any helm release is extant in the cluster at all, "helmfile apply" will attempt to run a "helm diff" between the release in the cluster and the proposed release, and only run helm upgrade if the diff shows a change.

While this is a sensible check for "deployed" releases, for failed (and possibly any other) release states, if the diff hasn't changed (even though the release never succeded), it results in the worst possible outcome: helmfile appears to finish successfully, while completely ignoring the failed release.

This ensures we always trigger an upgrade on releases that are in a non-deployed state. This way, if re-running with the same chart would succeed, we have the opportunity to fix things on rerun (let's say a helm hook pre or post-upgrade job will succeed now due to fixing a service external to the chart); if it wouldn't, by rerunning the upgrade, we will again see the error rather than it going under the radar and giving the false impression that everything is hunky dory.

@Secretions
Copy link
Author

@yxxhero Sorry, I didn't see the change you pushed, and accidentally orphaned it pushing a change of my own. If you still have that commit, would you mind pushing it again? Thanks!

@yxxhero
Copy link
Member

yxxhero commented Aug 8, 2023

@Secretions don't worry. I just rebased the code. do what you want to do.

@yxxhero
Copy link
Member

yxxhero commented Aug 8, 2023

@Secretions you should fix the conflicts.

Currently, if _any_ helm release is extant in the cluster at all,
"helmfile apply" will attempt to run a "helm diff" between the
release in the cluster and the proposed release, and only run helm
upgrade if the diff shows a change.

While this is a sensible check for "deployed" releases, for failed
(and possibly any other) release states, this results in the worst
possible outcome: helmfile *appears* to finish successfully, while
completely ignoring the failed release.

This skips the diff for non-deployed releases, treating it in the
same fashion as non-installed releases, always running the upgrade
for these particular releases. This way, if re-running with the
same chart would succeed, we have the opportunity to fix things on
rerun; if it wouldn't, by rerunning the upgrade, we will again see
the error rather than it going under the radar.

Signed-off-by: Joaquin Lopez <[email protected]>
Signed-off-by: Joaquin Lopez <[email protected]>
* Diff output changed slightly
* Location of temp files not under /tmp running tests on mac
* Update `helm plugin install` reference to use `.git` suffix
  * For some reason I haven't sussed out, I get "Unable to retrieve
    local repo information" without it. Clearly this works in some
    other environment, but doesn't seem like it should matter.
    I can revert this part if it's a problem.

Signed-off-by: Joaquin Lopez <[email protected]>
@stale
Copy link

stale bot commented Aug 29, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 29, 2023
@yxxhero yxxhero removed the wontfix This will not be worked on label Aug 29, 2023
@stale
Copy link

stale bot commented Sep 13, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 13, 2023
@yxxhero yxxhero added in progress and removed wontfix This will not be worked on labels Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants