flux-check-hook icon indicating copy to clipboard operation
flux-check-hook copied to clipboard

TypeError ("string indices must be integers, not 'str'",)

Open varac opened this issue 1 year ago • 1 comments

I'm using v0.5.0 of this hook, but I get this error:

[ERROR] vaultwarden-hr.yaml: TypeError ("string indices must be integers, not 'str'",)

vaultwarden-hr.yaml:

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: vaultwarden
  namespace: vaultwarden
spec:
  releaseName: vaultwarden
  chartRef:
    kind: OCIRepository
    name: vaultwarden
    namespace: flux-system
  interval: "24h"

vaultwarden-oci-repo.yaml:

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
  name: vaultwarden
  namespace: flux-system
spec:
  interval: 1h
  url: oci://tccr.io/truecharts/vaultwarden
  layerSelector:
    mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
    operation: copy
  ref:
    semver: "28.3.3"

varac avatar Sep 25 '24 08:09 varac

@jamiezieziula can you have a look?

tarioch avatar Sep 25 '24 10:09 tarioch

Also seeing this error with helm.toolkit.fluxcd.io/v2 only on a kube-prometheus-stack release and a custom values file of another chart.

LEI avatar Nov 11 '24 03:11 LEI

@tarioch @jamiezieziula Isn't this the typo int he code that is causing this issue? https://github.com/tarioch/flux-check-hook/blame/5cf8216341e96cd5594f6bce1a53f0942b72e0ac/pre_commit_flux/check_flux_helm_values.py#L59

definition["spec"["chartRef"]]

kadaan avatar Dec 18 '24 16:12 kadaan

thank you very much, I think that makes sense, adjusted. Can someone verify?

tarioch avatar Dec 18 '24 19:12 tarioch

I re-enabled the hook, made a test commit and it seems to work. Thank you !

varac avatar Dec 18 '24 19:12 varac