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

feat: Stabilize helmfile-diff output #1622

Merged
merged 1 commit into from
Dec 15, 2020
Merged

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Dec 15, 2020

This finishes the work started at #1619 by introducing the following changes:

  • You can now set HELMFILE_TEMPDIR and CHARTIFY_TEMPDIR as the directory to persist temporary values files rendered by helmfile and temporary charts generated by chartify. Note that chartify is used internally when you use kustomize integration or raw K8s manifests as a chart.

  • Helmfile uses the hash sum of the release config and the values file content in the file name of the temporary values file.

    In combination with HELMFILE_TEMPDIR and CHARTIFY_TEMPDIR, this enables helmfile to use the stable file names for temporary values files, which contribute to stabilize log messages like Comparing release=appset, chart=PATH/TO/TEMPORARY/CHART, where the PATH/TO/TEMPORARY/CHART had been randomized due to formerly random helmfile tempdir and temporary values file names, and random chartify tempdir.

You can try this feature with a script like:

tempdir=$(mktemp -d -t helmfile)

HELMFILE_TEMPDIR=${tempdir} CHARTIFY_TEMPDIR=${tempdir} helmfile diff

rm -rf ${tempdir}

This finishes the work started at #1619 by introducing the following changes:

- You can now set `HELMFILE_TEMPDIR` and `CHARTIFY_TEMPDIR` as the directory to persist temporary values files rendered by helmfile and temporary charts generated by chartify. Note that chartify is used internally when you use kustomize integration or raw K8s manifests as a chart.
- Helmfile uses the hash sum of the release config and the values file content in the file name of the temporary values file.

  In combination with `HELMFILE_TEMPDIR` and `CHARTIFY_TEMPDIR`, this enables helmfile to use the stable file names for temporary values files, which contribute to stabilize log messages like `Comparing release=appset, chart=PATH/TO/TEMPORARY/CHART`, where the `PATH/TO/TEMPORARY/CHART` had been randomized due to formerly random helmfile tempdir and temporary values file names, and random chartify tempdir.

You can try this feature with a script like:

```
tempdir=$(mktemp -d -t helmfile)

HELMFILE_TEMPDIR=${tempdir} CHARTIFY_TEMPDIR=${tempdir} helmfile diff

rm -rf ${tempdir}
```
@mumoshu mumoshu merged commit 9b64d65 into master Dec 15, 2020
@mumoshu mumoshu deleted the finish-stabilizing-diff-output branch December 15, 2020 01:24
mumoshu added a commit to mumoshu/terraform-provider-helmfile that referenced this pull request Jan 1, 2021
so that helmfile-diff output becomes stables and terraform plan doesn't break.
See roboll/helmfile#1622 for more information.
mumoshu added a commit to mumoshu/terraform-provider-helmfile that referenced this pull request Jan 1, 2021
so that helmfile-diff output becomes stables and terraform plan doesn't break.
See roboll/helmfile#1622 for more information.
@dudicoco
Copy link
Contributor

@mumoshu what's the default temp dir location if HELMFILE_TEMPDIR is not provided?

@mumoshu
Copy link
Collaborator Author

mumoshu commented Feb 2, 2021

@dudicoco Depends on what os.TempDir() returns, like somewhere under /var/tmp for macOS, which is the same as before.

@dudicoco
Copy link
Contributor

@mumoshu I've used HELMFILE_TEMPDIR and I don't see any temp files generated in the temp dir or in /var/tmp when running helmfile diff.

Any ideas?

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

Successfully merging this pull request may close these issues.

2 participants