Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fluentd): add image reference by digest #362

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Boojapho
Copy link
Contributor

@Boojapho Boojapho commented May 23, 2023

Related to #356

Adds ability to reference images by digest. Digest will override tag.

Also fixed fluentd test.
Closes: #440

@@ -10,7 +10,16 @@ kind: "DaemonSet"
image:
repository: "fluent/fluentd-kubernetes-daemonset"
pullPolicy: "IfNotPresent"
tag: ""
tag: "" # Set to "-" to not use the default value
Copy link
Collaborator

@dioguerra dioguerra Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I just tested and everything works fine.

Just drop the comment in front of tag which is not required...

helm template fluentd . -n kube-system -s templates/daemonset.yaml --set image.repository=myrepo/myimage --set image.tag=1.1.1 --set image.digest=sha256:4a1c4b21597c1b4415bdbecb28a3296c6b5e23ca4f9feeb599860a1dac6a0108

@@ -2,7 +2,7 @@ apiVersion: v2
name: fluentd
description: A Helm chart for Kubernetes
# type: application
version: 0.4.3
version: 0.4.4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this

Fluentd image with tag/digest
*/}}
{{- define "fluentd.image" -}}
{{- $tag := ternary "" (printf ":%s" (toString .tag)) (or (empty .tag) (eq "-" (toString .tag))) -}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tags and hashes can coexist, where hash will always takes precedence over the tag, even if they dont match.

With this info you should be able to simplify this. Although it works as it is...

@dioguerra
Copy link
Collaborator

Thank you for your contribution @Boojapho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fluentd] Fix CI tests file
2 participants