Skip to content

fix(gcp): correct version name in LatestOrFetch fallback#5678

Closed
pacharrin wants to merge 1 commit intoexternal-secrets:mainfrom
pacharrin:ac-fix-latestorfetch
Closed

fix(gcp): correct version name in LatestOrFetch fallback#5678
pacharrin wants to merge 1 commit intoexternal-secrets:mainfrom
pacharrin:ac-fix-latestorfetch

Conversation

@pacharrin
Copy link
Copy Markdown

@pacharrin pacharrin commented Dec 4, 2025

Problem Statement

When using secretVersionSelectionPolicy = "LatestOrFetch" on a GSM secret store

If the latest secret is DESTROYED, the sync fails and you see this when running kubectl describe es secret

...
Events:
  Type     Reason        Age                From              Message
  ----     ------        ----               ----              -------
  FailedPrecondition desc = Secret Version [projects/225994000000/secrets/application-secrets/versions/17] is in DESTROYED state.
  Warning  UpdateFailed  16m (x4 over 22m)  external-secrets  error processing spec.dataFrom[1].extract, err: unable to access Secret from SecretManager Client: rpc error: code = InvalidArgument desc = The provided Secret ID [projects/gcp-project/secrets/application-secrets/versions/projects/225994000000/secrets/application-secrets/versions/15] does not match the expected format [projects/*/secrets/*/versions/*]
  

Proposed Changes

  • In client.go, the AccessSecretVersionRequest now uses latestVersion.Name directly for the Name field, instead of formatting the string manually.

Checklist

  • I have read the contribution guidelines
  • All commits are signed with git commit --signoff
  • All tests pass with make test
  • I ensured my PR is ready for review with make reviewable

Signed-off-by: Alexis Cervantes <alexis@repl.it>
@github-actions github-actions bot added area/gcp Issues / Pull Requests related to gcp provider kind/bug Categorizes issue or PR as related to a bug. size/xs labels Dec 4, 2025
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Dec 4, 2025

@Skarlso
Copy link
Copy Markdown
Contributor

Skarlso commented Dec 10, 2025

I'm pretty sure that's intentional and removing it will break something. Paging @itaispiegel for more info. :)

@pacharrin
Copy link
Copy Markdown
Author

Addressed in #5610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/gcp Issues / Pull Requests related to gcp provider kind/bug Categorizes issue or PR as related to a bug. size/xs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants