tarioch / flux-check-hook

MIT License
31 stars 6 forks source link

Doesn't work with OCI repositories #8

Closed fastlorenzo closed 11 months ago

fastlorenzo commented 1 year ago

Hi, quickly reporting an issue, I've noticed this hook doesn't work when using OCI repositories.

Example:

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: bitnami
  namespace: flux-system
spec:
  type: oci
  interval: 5m
  url: oci://registry-1.docker.io/bitnamicharts

This will result in:

[ERROR] helm pull: 
Error: looks like "oci://registry-1.docker.io/bitnamicharts" is not a valid chart repository or cannot be reached: object required

I think this is mainly related to the way the helm pull command is done here: https://github.com/tarioch/flux-check-hook/blob/a5444fbf951c8d26b59fa36c6ca01f87ad63f1c4/pre_commit_flux/check_flux_helm_values.py#L70

With OCI, it should be helm pull oci://registry-1.docker.io/bitnamicharts/redmine instead of helm pull --repo oci://registry-1.docker.io/bitnamicharts redmine

tarioch commented 1 year ago

Thanks for your report, would you mind trying to create a pr for this?

jcelaya commented 11 months ago

Hi, I created the PR for you https://github.com/tarioch/flux-check-hook/pull/9