jrz
jrz

Reputation: 1397

helm - digest parameter in index.yml file

When I run

helm repo index ....

There is an auto generated parameter called 'digest'. example:

 - created: 2020-05-06T00:39:45.220619461+03:00
description: blabla
digest: 7e16fe42a5bb6a6859ce6f9f1cdb3dd6821addc6e5193080d9d444faa1a6fc31

What is this parameter and what is it used for? is it important?

Upvotes: 2

Views: 3291

Answers (1)

winston
winston

Reputation: 549

digest is an Hash of the helm charts archive file. it's used to verify the integrity of the downloaded helm chart. I have been looking for documentation on this particular thing, but couldn't really find any so instead, here are the relevant parts from the helm source code:

First, this is from the function that creates the index.yaml file when you run helm repo index: https://github.com/helm/helm/blob/984d2ac7676874ae78a7617f7417513a7a9b5ef2/pkg/repo/index.go#L270

in the line marked, a sha256 hash is created from the helm chart. The function used for that (provenance.DigestFile()) has the following to say:

// DigestFile calculates a SHA256 hash (like Docker) for a given file.
//
// It takes the path to the archive file, and returns a string representation of
// the SHA256 sum.
//
// The intended use of this function is to generate a sum of a chart TGZ file.
func DigestFile(filename string) (string, error)

I'm currently struggling to find the relevant code sections that actually use that digest, so take what i said with a grain of salt.

Upvotes: 5

Related Questions