diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 86b9beb..c54b732 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -25,7 +25,7 @@ Renders run in parallel, in memory, client-side (like `helm template`). Nothing | `name` with `--repo URL` | an HTTP repository: `index.yaml`, then the `.tgz`, or the registry the index points at, as Bitnami's does | | `oci://...`, or `--repo oci://...` | an OCI registry, with the credentials of `helm registry login`; a digest (`oci://...@sha256:...`, or `--version sha256:...`) pulls that exact chart | -Without `--version`, the latest chart is used; a range (`1.x`, `>=1.0.0`) picks the highest match. Remote charts are loaded in memory and cached as `.tgz` in the user cache directory (`~/.cache/deadvalues` on Linux), or `--cache-dir`; `--no-cache` always downloads. A download that fails on the network (a timeout, a dropped connection, a 502, 503 or 504) is tried again after 2, 5 and 10 seconds, and so is a render whose `values.schema.json` points at a schema by URL; a 401, 403 or 404 is reported at once. If the network is still down after that, the rest of the run does not wait again. A refusal says what to check before the registry's own answer: an OCI registry answers 401 or 403 both to a private chart and to one that does not exist, so it points to `helm registry login`; an HTTP repository that asks for credentials points to `helm repo add`; a 404 to the chart name and version. +Without `--version`, the latest chart is used; a range (`1.x`, `>=1.0.0`) picks the highest match. Remote charts are loaded in memory and cached as `.tgz` in the user cache directory (`~/.cache/deadvalues` on Linux), or `--cache-dir`; `--no-cache` always downloads. A download that fails on the network (a timeout, a dropped connection, a 502, 503 or 504) is tried again after 2, 5 and 10 seconds, and so is a render whose `values.schema.json` points at a schema by URL; a 401, 403 or 404 is reported at once. If the network is still down after that, the rest of the run does not wait again. A refusal says what to check before the registry's own answer: an OCI registry answers 401 or 403 both to a private chart and to one that does not exist, so it points to `helm registry login`, and so does a registry that asks for a login Helm has no credentials for; an HTTP repository that asks for credentials points to `helm repo add`; a 404 to the chart name and version. The dependencies a chart's `charts/` directory lacks are downloaded too, at the versions of `Chart.lock`, as Argo CD and Flux do before rendering, and `file://` dependencies are read from disk. A local chart is still analyzed when one cannot be fetched, without network for instance: a note names it, because the keys only that dependency reads can look dead. diff --git a/internal/source/source.go b/internal/source/source.go index 07f4376..c1a8bb6 100644 --- a/internal/source/source.go +++ b/internal/source/source.go @@ -273,7 +273,7 @@ func (l *Loader) http(ctx context.Context, ref Ref) (*chart.Chart, error) { } var ( - denied = regexp.MustCompile(`status code 40[13]\b|: 40[13] |\b(denied|unauthorized)\b`) + denied = regexp.MustCompile(`status code 40[13]\b|: 40[13] |\b(denied|unauthorized)\b|basic credential not found`) notFound = regexp.MustCompile(`status code 404\b|: 404 |manifest unknown`) ) diff --git a/internal/source/source_test.go b/internal/source/source_test.go index 7fdba45..15ce1b6 100644 --- a/internal/source/source_test.go +++ b/internal/source/source_test.go @@ -137,6 +137,7 @@ func TestRefusedSaysWhatToCheck(t *testing.T) { want string }{ {ghcr, "ghcr.io/home-operations/charts-mirror/trivy-operator", true, "not found, or private and no credentials (for a private registry, run `helm registry login ghcr.io`): failed to perform"}, + {errors.New(`failed to perform "FetchReference" on source: GET "https://ocharted.jory.dev/v2/x/headlamp/manifests/0.45.0": basic credential not found`), "ocharted.jory.dev/x/headlamp", true, "not found, or private and no credentials (for a private registry, run `helm registry login ocharted.jory.dev`): failed to perform"}, {errors.New("GET https://charts.example.com/index.yaml: 401 Unauthorized"), "https://charts.example.com", false, "access denied (for a private repository, add it with `helm repo add`"}, {errors.New(`GET "https://ghcr.io/v2/x/manifests/9.9.9": response status code 404: manifest unknown`), "ghcr.io/x", true, "not found, check the chart name and version: "}, {errors.New("dial tcp 1.2.3.4:443: connect: connection refused"), "ghcr.io/x", true, "dial tcp"},