[9.0](backport #6841) [k8s] improve kubernetes_secrets provider secret logging #7008
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.
What does this PR do?
This PR enhances the logging of the
kubernetes_secrets
provider to improve visibility into secret updates and cache operations. The changes include:fetchFromAPI
to return the resource version of a secret.fetchFromAPI
to validate secret retrieval behavior.Why is it important?
Previously, the
kubernetes_secrets
provider had minimal logging, making it difficult to determine when secrets were updated, expired, or failed to refresh. This lack of visibility led to troubleshooting challenges, especially in cases where secrets did not rotate as expected. With these improvements, users can now track secret updates more effectively without exposing sensitive values.Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
This change does not alter the core functionality of the
kubernetes_secrets
provider but improves logging. Users should see more detailed logs related to secret updates, which can be useful for debugging. There are no breaking changes expected.How to test this PR locally
Run the
kubernetes_secrets
provider unit-testsRelated issues
This is an automatic backport of pull request #6841 done by [Mergify](https://mergify.com).