ChristofferNissen / helmper

Import Helm Charts to OCI registries, optionally with vulnerability patching
https://christoffernissen.github.io/helmper/
Apache License 2.0
140 stars 5 forks source link

k8s_version is not optional #89

Closed abohne closed 1 month ago

abohne commented 1 month ago

The config docs state that k8s_version is an optional field and should default to 1.27.9, however, if you don't specify k8s_version in helmper.yaml, the app exists with a panic.

helmper.yaml

verbose: true
import:
  enabled: true
charts:
- name: loki
  version: 5.38.0
  repo:
    name: grafana
    url: https://grafana.github.io/helm-charts/

 _         _
| |_  ___ | | _____  ___  ___  ___
|   || -_|| ||     || . || -_||  _|
|_|_||___||_||_|_|_||  _||___||_|
                    |_|
version 0.1.13 (commit fb537925fa03ff2bdbef970e94ccd48eba91c86a, built at 2024-07-26T13:20:18Z)

panic: interface conversion: interface {} is nil, not string

goroutine 1 [running]:
github.com/ChristofferNissen/helmper/pkg/util/state.GetValue[...](...)
    /home/runner/work/helmper/helmper/pkg/util/state/state.go:8
github.com/ChristofferNissen/helmper/internal.Program({0xc000138050, 0x0, 0x0})
    /home/runner/work/helmper/helmper/internal/program.go:44 +0x3d25
main.main()
    /home/runner/work/helmper/helmper/cmd/helmper/main.go:12 +0x49
ChristofferNissen commented 1 month ago

Thanks for reporting this. Will fix in next release

ChristofferNissen commented 1 month ago

Thank you for opening this issue. This should now be fixed, let me know if it still causes problems on your end.