Helmfile: Does helmfile template retain temporary files ?

Created on 27 Oct 2020  路  8Comments  路  Source: roboll/helmfile

Hi,

I would like to access a temporary file, so I can debug issues there.

PATH:
  /home/app/tools/helm

ARGS:
  0: helm (4 bytes)
  1: template (8 bytes)
  2: drone (5 bytes)
  3: ../charts/drone (15 bytes)
  4: --namespace (11 bytes)
  5: team-admin (10 bytes)
  6: --values (8 bytes)
  7: /tmp/values110545780 (20 bytes)

ERROR:
  exit status 1

EXIT STATUS
  1

STDERR:
  Error: failed to parse /tmp/values110545780: error converting YAML to JSON: yaml: line 35: mapping values are not allowed in this context

The /tmp/values110545780 file does not exists after helmfile template exits with error.
Is there any option to retain temporary files?

I am using the following versions and plugins:

helmfile version
helmfile version v0.128.1
helm version                                                                                                                                       
version.BuildInfo{Version:"v3.3.1", GitCommit:"249e5215cde0c3fa72e27eb7a30e8d55c9696144", GitTreeState:"clean", GoVersion:"go1.14.7"}
helm plugin list                                                                                                                                 
NAME    VERSION DESCRIPTION                                                                  
diff    3.1.2   Preview helm upgrade changes as a diff                                       
secrets 2.0.2   This plugin provides secrets values encryption for Helm charts secure storing
feature request good-first-issue help wanted

All 8 comments

I constantly run into this issue and I have not found a reliable way to see the temporary file contents. I end up stumbling through my charts/values files trying to find the YAML syntax error.

I would really like a --retain-tempfiles option or --keep-tempfiles-on-error

Or maybe a YAML validation during template compilation prior to writing the tempfile?

@ruckchelmfile apply has --retain-values-files for that. Do we need the same flag also for helmfile template?

@mumoshu The helmfile template is very useful tool for debugging, developing and smoke testing states/values/charts all together. It also does not even require a k8s cluster - great.

Having '--retain-values-files' parameter for helmfile template would greatly improve my development workflow.

@j-zimnowoda Got it. Thanks for clarifying!

@j-zimnowoda Btw, do either or both ofhelmfile build --embed-values and/or helmfile write-values (https://github.com/roboll/helmfile/pull/1469) help your use-case, too?

@mumoshu thanks for response and hints. It is good to know about these new parameters.
Unfortunately, they do not really help, because they do not print/write values for broken helmfiles
E.g.:

Writing values file helmfile-19.ingress-init-a73fd5f6/jobs-keycloak.yaml
in helmfile.d/helmfile-19.ingress-init.yaml: unmarshalling yaml /var/folders/_p/bqn_80dx6lv30c4grntbhy3h0000gn/T/values812929937: yaml: line 10: did not find expected comment or line break

These files do not exist after calling helmfile write-values
Same for helmfile build --embed-values, it does not render values forhelmfile-19.ingress-init.yaml`

helmfile version v0.132.1

Even if it would, then there are still way too many lines that I need to scroll over in order to analyse the root cause of the problem. Ability to access tempfiles would mitigate this issue.

@mumoshu I don't see --skip-cleanup recognized as a flag for helmfile template. Would it be a lot of work to add it there too?

@Morriz It should be a good-first-issue 馃槂

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelpporter picture michaelpporter  路  3Comments

cilerler picture cilerler  路  4Comments

aslafy-z picture aslafy-z  路  4Comments

willejs picture willejs  路  4Comments

ppawiggers picture ppawiggers  路  3Comments