I have uploaded a secret to secret manager and am fetching it successfully from my firebase function. I needed to change the secret value, so I disabled the version 1 and made a version 2 with the updated value. However, fetching the version using the secretmanagerclient for nodejs only returns version 1. I have redeployed the function a few times and nothing. I thought it might be a cache issue but I assume redeploying clears that?
When fetching the secret are you using the "latest" version? Or are you specifying a version? Can you share the code snippet that's getting the secret?
For example, in this sample https://cloud.google.com/secret-manager/docs/access-secret-version#secretmanager-access-secret-versi..., if you specify "latest" in your secret code then it will make sure it's always getting the latest version of the secret.
@jkg I'm running into the same issue.
I have the reference direct in my cloud function:
name = "projects/99/secrets/mysecrents/versions/latest"
If I change my secret at 1:00pm. Then I query at 1:01 - I don't get the latest secret occasionally.
I'm wondering if there is something with caching and cold starts? What if the function isn't cold started... will it always use the old token until its restarted? I'm seeing a trend