Backport of add interpolation support in env stanzas for secret providers into release/1.11.x#27621
Merged
mismithhisler merged 1 commit intorelease/1.11.xfrom Mar 2, 2026
Conversation
mismithhisler
approved these changes
Mar 2, 2026
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.
Backport
This PR is auto-generated from #27568 to be assessed for backporting due to the inclusion of the label backport/1.11.x.
The below text is copied from the body of the original PR.
Summary
env {}values in thesecretstanza when using custom plugin providers${secret.X.Y},${node.*}, and${NOMAD_*}inside plugin env blocksFetch()is calledContext
#27569
Implementation
The interpolation machinery already exists in
helper/args.ReplaceEnvandtaskenv.TaskEnv.ReplaceEnv— it just wasn't wired up for the secret.env block.Changes:
SetEnv(map[string]string)to theSecretsPlugininterface and implement it onexternalSecretsPlugin. This allows updating a plugin's environment variables after construction.InterpolateEnv(rawEnv, interpolate)toExternalPluginProvider. Applies an interpolation function to all env values and updates the underlying plugin viaSetEnv.buildSecretProviders()now also returns the raw env maps alongside the plugin providersPrestart()interpolates plugin env values afterh.envBuilder.SetSecrets(m)(template secrets resolved) but before the pluginFetch()loop, usingtaskEnv.ReplaceEnvwhich already supports${secret.*},${node.*}, and${NOMAD_*}referencesScope
Testing
Overview of commits