Skip to content

feat: support templating in extraInitContainers#399

Open
jwoloch wants to merge 4 commits intooauth2-proxy:mainfrom
jwoloch:main
Open

feat: support templating in extraInitContainers#399
jwoloch wants to merge 4 commits intooauth2-proxy:mainfrom
jwoloch:main

Conversation

@jwoloch
Copy link
Copy Markdown

@jwoloch jwoloch commented Mar 24, 2026

Description

Enable Helm template expressions in extraInitContainers by wrapping toYaml output with tpl function, allowing dynamic values from release metadata, config maps, and secrets.

Checklist:

  • I have bumped the version in the Chart.yaml according to Semantic Versioning.
  • I have updated the documentation/CHANGELOG at the bottom of the Chart.yaml
  • I have signed off all my commits.
  • (Optional) I have updated the Chart.lock for dependency updates
  • (Optional) I have implemented helm tests for new feature flags

Enable Helm template expressions in extraInitContainers by wrapping
toYaml output with tpl function, allowing dynamic values from
release metadata, config maps, and secrets.

Signed-off-by: Józef Wołoch <jozek.woloch@gmail.com>
@jwoloch jwoloch marked this pull request as ready for review March 24, 2026 07:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Helm templating support to the extraInitContainers chart value so users can reference release metadata and other templated values inside init container definitions.

Changes:

  • Wrap extraInitContainers rendering with tpl to evaluate Helm template expressions.
  • Bump chart version and update Artifact Hub changelog entry for the release.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
helm/oauth2-proxy/templates/deployment.yaml Evaluates templated content in extraInitContainers via tpl when rendering the Deployment.
helm/oauth2-proxy/Chart.yaml Updates chart version and Artifact Hub changes annotation for the new behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,5 +1,5 @@
name: oauth2-proxy
version: 10.3.0
version: 10.3.1
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Chart version bump looks like a SemVer patch (10.3.0 -> 10.3.1), but this PR introduces new functionality (templating support in extraInitContainers). Per SemVer and the repo's versioning guidance, consider bumping the minor version instead (or clarify why this is treated as a patch-level change).

Suggested change
version: 10.3.1
version: 10.4.0

Copilot uses AI. Check for mistakes.
- kind: added
description: Add tpl support for config.cookieName, config.existingSecret, customLabels, image.registry, imagePullSecrets, and networkPolicy.ingress/egress
- kind: changed
description: feat: support templating in extraInitContainers
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

This change adds templating support for the existing extraInitContainers value, but the user-facing docs don’t mention that extraInitContainers now supports tpl (unlike extraEnv, which is documented in the chart README). Please update the chart documentation (README and/or the values.yaml comments) to reflect the new templating behavior and any gotchas (e.g., {{ ... }} sequences will now be evaluated).

Suggested change
description: feat: support templating in extraInitContainers
description: feat: support templating in extraInitContainers (values are now rendered with tpl, so {{ ... }} sequences will be evaluated as Helm templates rather than treated as literal text)

Copilot uses AI. Check for mistakes.
@pierluigilenoci
Copy link
Copy Markdown
Member

@jwoloch, can you check the Copilot conversation?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -31,7 +31,7 @@ kubeVersion: ">=1.16.0-0"
annotations:
artifacthub.io/changes: |
- kind: changed
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

The Artifact Hub changelog entry uses kind: changed, but this PR adds new functionality (templating support) rather than modifying existing behavior for default values. Consider using kind: added to better reflect the nature of the change in release notes.

Suggested change
- kind: changed
- kind: added

Copilot uses AI. Check for mistakes.
@tuunit
Copy link
Copy Markdown
Member

tuunit commented Mar 31, 2026

Could we stop opening a single PRs for each next element we want to add tpl to? Could we please just open one large PR for this?

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.

4 participants