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

could not find protocol handler for #41

Closed haarchri closed 3 months ago

haarchri commented 3 months ago

after a few tries for gke registry logins - i get only the following issue:

helmper --f sync.yaml

 _         _
| |_  ___ | | _____  ___  ___  ___
|   || -_|| ||     || . || -_||  _|
|_|_||___||_||_|_|_||  _||___||_|
                    |_|
version 0.1.4 (commit 2999f891aba1adbe55b8365115f84492b99c1376, built at 2024-05-30T12:19:03Z)

{"time":"2024-06-11T01:18:16.494742+03:00","level":"ERROR","msg":"could not find protocol handler for: "}
k8s_version: 1.27.9
import:
  enabled: true
charts:
- name: prometheus
  version: 25.8.0
  valuesFile: /workspace/in/values/prometheus/values.yaml # (Optional)
  repo:
    name: prometheus-community
    url: https://prometheus-community.github.io/helm-charts/
registries:
- name: registry
  url: 0.0.0.0:5002
  insecure: true
  plainHTTP: true
 docker ps
CONTAINER ID   IMAGE        COMMAND                  CREATED         STATUS         PORTS                    NAMES
9a3cfa086576   registry:2   "/entrypoint.sh /etc…"   2 minutes ago   Up 2 minutes   0.0.0.0:5002->5000/tcp   registry
haarchri commented 3 months ago

okay found it

removed the following entry from: /Users/haarchri/Library/Preferences/helm/repositories.yaml

- caFile: ""
  certFile: ""
  insecure_skip_tls_verify: false
  keyFile: ""
  name: abc/abc/xx
  pass_credentials_all: false
  password: ""
  url: us-west1-docker.pkg.dev
  username: ""
ChristofferNissen commented 3 months ago

Hi @haarchri, Did this entry appear due to Helmper, or was it already present in the config?

haarchri commented 3 months ago

This was added by helmper

ChristofferNissen commented 3 months ago

I see this is related to #40 as Helmper has added the entry to the repositories.yaml file, which does not work when using helm repo add with the Helm SDK. To avoid this causing problems, i will add a simple check to confirm the repo has http/https protocol before adding it to the repositories.yaml file

These commands does not work:

helm repo add test prometheus-community.github.io/helm-charts/
helm repo add test oci://prometheus-community.github.io/helm-charts/
helm repo add test tcp://prometheus-community.github.io/helm-charts/

These commands works

helm repo add test https://prometheus-community.github.io/helm-charts/
helm repo add test http://prometheus-community.github.io/helm-charts/

It looks like helm repositories does not currently support OCI, only the following commands has support for OCI:

https://helm.sh/docs/topics/registries/#commands-for-working-with-registries

I will have to consider how Helmper is supposed to work when the source is OCI, for now i guess Helmper only works when targeting OCI registries