Repository navigation
feat: render imagePullSecrets, nodeSelector and tolerations through tpl - #146
Open
johnyrahul wants to merge 1 commit into
Open
johnyrahul wants to merge 1 commit into
johnyrahul wants to merge 1 commit into
Conversation
Adds pgdog.tplvalues.render (the Bitnami tplvalues.render pattern) and uses it for imagePullSecrets, nodeSelector and tolerations on the PgDog Deployment and for prometheusCollector.nodeSelector / tolerations, so a parent chart can point them at its own global values. A string is rendered as a template producing the whole field; a map or list is rendered with toYaml first, so its leaves may be templated. Values without template markers render unchanged. Chart version v0.85. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Renders
imagePullSecrets,nodeSelectorandtolerationson the PgDog Deployment through a newpgdog.tplvalues.renderhelper instead of plaintoYaml. The same applies toprometheusCollector.nodeSelector/tolerations. Chart version bumped to v0.85.Why
When this chart is a dependency of a parent chart, these fields can't follow the parent's
global.*values. The templates read.Values.imagePullSecrets/nodeSelector/tolerationsdirectly, and Helm values can't reference other values. Today the parent has to copy its pull secret and placement intopgdog:by hand, or bridge them with YAML anchors, which only work within a single values file. An install whose global pull secret or node pool differs then ends up with PgDog inImagePullBackOff, or scheduled on nodes it shouldn't be on.How
pgdog.tplvalues.renderfollows the Bitnamicommon.tplvalues.renderpattern:tolerations: '{{ toYaml .Values.global.tolerations }}';toYamland then rendered, so individual leaves can be templated, e.g.nodeSelector: {pool: '{{ .Values.global.pool }}'}.Values without
{{ }}render exactly as before. Whole-field strings matter when the parent's value has a different shape: a list of key/value pairs becomes anodeSelectormap, and a pull-secret list may be empty. That can't be expressed by templating leaves alone.As with any
tpl-rendered value, don't put untrusted input in these fields.Compatibility
Existing values render byte-identical. I rendered every
test/values-*.yamlwith v0.84 and with this branch; all match exceptvalues-tls-generate.yaml, whose generated certificate differs on every render anyway.Tests
test/values-tpl-placement.yaml: whole-field templates forimagePullSecretsandtolerations, and a leaf template fornodeSelector, all pointing atglobal.*.test/test.sh: asserts the rendered Deployment carries the templated values, and that the default values still produce noimagePullSecrets.🤖 Generated with Claude Code