Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion internal/source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
)

Expand Down
1 change: 1 addition & 0 deletions internal/source/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
Loading