vectordotdev / helm-charts

Helm charts for Vector.
https://vector.dev
Mozilla Public License 2.0
111 stars 90 forks source link

feat(vector): Add digest option to vector image #219

Closed tomer-epstein closed 2 years ago

tomer-epstein commented 2 years ago

Signed-off-by: Tomer Epstein tomer.epstein@sap.com

Motivation add better integrity to the image version, we should provide a way to add a digest option to the chart images this way we can validate the image version

Approach How does this change address the problem?

Add digest option to vector chart, By adding a new sha field to the pod file and concatenate it to the image string address when provided.

Pull Request status

spencergilbert commented 2 years ago

Thanks for the contribution - Digests would be usable today by just passing image.tag: 0.22.1-distroless-libc@sha256:ba208391be6f7705f5e7bf7513ad7600cf8cc2c5dff3a4691632de3afbf0bcd0, right? This is just a more friendly way of exposing it?

tomer-epstein commented 2 years ago

It's more then just a friendly way.

by passing a tag that conains a digest, the labels section in the vector chart will fail. https://github.tools.sap/api-gateway/vector-chart-wrapper/blob/65a14f1ad36255eb3146f8df826b6221cd617d29/vector/charts/vector/templates/_helpers.tpl#L40

label values in k&s are allowing only specific syntax. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

Example of using digest (and tag as comment before the digest) OR tag in grafana: https://github.com/grafana/helm-charts/blob/main/charts/grafana/templates/_pod.tpl#L397-L401

spencergilbert commented 2 years ago

It's more then just a friendly way.

by passing a tag that conains a digest, the labels section in the vector chart will fail. https://github.tools.sap/api-gateway/vector-chart-wrapper/blob/65a14f1ad36255eb3146f8df826b6221cd617d29/vector/charts/vector/templates/_helpers.tpl#L40

label values in k&s are allowing only specific syntax. https://github.tools.sap/api-gateway/vector-chart-wrapper/blob/65a14f1ad36255eb3146f8df826b6221cd617d29/vector/charts/vector/templates/_helpers.tpl#L40

Example of using digest (and tag as comment before the digest) OR tag in grafana: https://github.com/grafana/helm-charts/blob/main/charts/grafana/templates/_pod.tpl#L397-L401

Ah good point - I didn't think about that. I haven't written up a contributing doc yet, but we'll need to bump the minor version and run helm-docs to update the readme. I'm happy to do that if you'd prefer.

tomer-epstein commented 2 years ago

Sure, go for it. Will you do it on this PR?

tomer-epstein commented 2 years ago

@spencergilbert can you approve?

tomer-epstein commented 2 years ago

🤦 Tnx @spencergilbert Appriciate the very quick response.