Skip to content

Add time-based caching for K8sConfig.getClient()#6742

Merged
bentsherman merged 4 commits intomasterfrom
k8s-client-refresh-interval
Jan 21, 2026
Merged

Add time-based caching for K8sConfig.getClient()#6742
bentsherman merged 4 commits intomasterfrom
k8s-client-refresh-interval

Conversation

@pditommaso
Copy link
Member

Summary

  • Replace @Memoized with a Guava time-based cache that expires after a configurable interval (default 50 minutes)
  • Add new config option k8s.clientRefreshInterval to control the refresh interval
  • Allows Kubernetes client configuration to be refreshed periodically, useful for environments where credentials or tokens expire

Changes

  • Added clientRefreshInterval config option (default: 50m)
  • Added clientCache field using Guava Cache<String, ClientConfig>
  • Refactored getClient() to use cache with getClient0() as the loader

Closes #6741

Test plan

  • Added test for clientRefreshInterval default and custom values
  • Added test verifying cache behavior and expiration

🤖 Generated with Claude Code

@pditommaso pditommaso requested a review from jorgee January 21, 2026 10:51
@netlify
Copy link

netlify bot commented Jan 21, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 822c045
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6970aff41ca49e00083865ba

Closes #6741

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso force-pushed the k8s-client-refresh-interval branch from 4913396 to 7d2f4c1 Compare January 21, 2026 10:55
@nextflow-io nextflow-io deleted a comment from netlify bot Jan 21, 2026
@nextflow-io nextflow-io deleted a comment from netlify bot Jan 21, 2026
@nextflow-io nextflow-io deleted a comment from netlify bot Jan 21, 2026
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso requested a review from a team as a code owner January 21, 2026 10:58
Copy link
Contributor

@jorgee jorgee left a comment

Choose a reason for hiding this comment

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

Changes look fine.
I just miss the version added in docs.

Co-authored-by: Jorge Ejarque <jorgee@users.noreply.github.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@bentsherman bentsherman merged commit 73e5075 into master Jan 21, 2026
24 checks passed
@bentsherman bentsherman deleted the k8s-client-refresh-interval branch January 21, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

k8s plugin must check for valid cluster token

3 participants