allow users to define secret provider plugin timeouts in secret blocks#27622
Open
ubiquitousbyte wants to merge 2 commits intohashicorp:mainfrom
Open
allow users to define secret provider plugin timeouts in secret blocks#27622ubiquitousbyte wants to merge 2 commits intohashicorp:mainfrom
ubiquitousbyte wants to merge 2 commits intohashicorp:mainfrom
Conversation
Contributor
|
@ubiquitousbyte thanks so much for your really thorough write up and for taking up the issue! I'll review it today. |
tehut
reviewed
Mar 4, 2026
Contributor
tehut
left a comment
There was a problem hiding this comment.
@ubiquitousbyte I took a look at this today. I agree with your assertion that this customization doesn't belong on the client level, but I'm not sure that it belongs in the task definition, either.
This feels like a plugin concern and something that should be configurable by cluster operators rather than job authors.
Given the limited means of passing information from the common plugins to Nomad, I understand the choice but I'd like to spend a bit more time with it to see if we can't come up with a more an alternative.
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.
Context
The hardcoded 10-second timeout for secret provider plugins is insufficient for some integrations, as reported in #27618.
Solution
This PR adds a configurable timeout field to the secret block in job specifications, allowing operators to tune timeouts per-secret based on their backend's latency requirements.
I initially considered adding a client-level configuration, but opted for per-secret configuration instead for a bunch of reasons:
Implementation
Rather than adding a required timeout parameter to all plugin constructor calls, I implemented the functional options pattern commonly used in Go and throughout the Nomad codebase.
I think this has some benefits. It does not break existing callers, future options (e.g for retries, logging?) can be added without breaking changes and the default behavior is preserved.
Changes
API & Structs
Timeout time.Durationfield to Secret struct in both API and internal representationsCanonicalize()defaults unspecified timeouts to 10s to keep things backwards compatible.Equal()andCopy()methods to handle timeout field.ApiTaskToStructsTaskto copy overTimeoutfield.Plugin Implementation
SecretsPluginOptionfunctional option typeWithTimeout(duration)option constructorNewExternalSecretsPlugin()to accept variadic optionsFingerprint()andFetch()operations use the configured timeout.Integration
WithTimeout(s.Timeout)when creating external pluginsUsage Example
Closes #27618