Skip to content

feat: make k8Secrets auth provider secret cache TTL configurable#2581

Open
ramasai1 wants to merge 2 commits into
notaryproject:v1-devfrom
ramasai1:make-expireson-configurable
Open

feat: make k8Secrets auth provider secret cache TTL configurable#2581
ramasai1 wants to merge 2 commits into
notaryproject:v1-devfrom
ramasai1:make-expireson-configurable

Conversation

@ramasai1

Copy link
Copy Markdown

Description

Make the cache TTL for k8Secrets provider configurable.

Which issue(s) does this PR resolve?

Fixes #2580

Type of change

  • New feature (non-breaking change which adds functionality)
  • Helm chart change (any edit/addition/update that is necessary for changes merged to the main branch)

Testing and verification

Unit tests.

Checklist

  • Does the affected code have corresponding tests?
  • Are the changes documented, not just with inline documentation, but also with conceptual documentation such as an overview of a new feature, or task-based documentation like a tutorial? Consider if this change should be announced on your project blog.
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have appropriate license header?

Post merge requirements

  • MAINTAINERS: manually trigger the "Publish Package" workflow after merging any PR that indicates Helm Chart Change

Signed-off-by: Ramasai Venkatsitarambhaskar Tadepalli <ramasai.tadepalli@mongodb.com>
@ramasai1 ramasai1 force-pushed the make-expireson-configurable branch from d73e3b4 to b6c8568 Compare June 11, 2026 16:30
}

func (d *k8SecretAuthProvider) getSecretTimeout() time.Duration {
if d.config.SecretTimeout == 0 {

@fseldow fseldow Jun 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it might be confusing when secretTimeout is mually set as 0. User may expect to disable cache however currrent logic will fallback to default 12h

What about set secretTimeout as one pointer?

Then
if config.SecretTimeout == nil -> return defaultSecretTimeout

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@fseldow Thank you for your review, I have made the requested changes.

@ramasai1 ramasai1 requested a review from fseldow June 12, 2026 13:32
Signed-off-by: Ramasai Venkatsitarambhaskar Tadepalli <ramasai.tadepalli@mongodb.com>
@ramasai1 ramasai1 force-pushed the make-expireson-configurable branch from 13e70b2 to 6128881 Compare June 12, 2026 13:33
Name string `json:"name"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
Secrets []secretConfig `json:"secrets,omitempty"`
SecretTimeout uint32 `json:"secretTimeout,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

may forget to update in readme

@fseldow fseldow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

one small comment in doc, others lgtm
cc @susanshi for review or vote from maintainer

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.

2 participants