oci-go-sdk icon indicating copy to clipboard operation
oci-go-sdk copied to clipboard

CustomProfileConfigProvider is caching file config, no way to invalidate the cache

Open dariusbakunas opened this issue 8 months ago • 0 comments

I was working on a client app that uses OCI sdk, which is using external oci cli binary to create new sessions. Problem is, on the first load it caches the oci configuration file in global cache (https://github.com/oracle/oci-go-sdk/blob/master/common/configuration.go#L430) so any new profiles that are created using oci cli are no longer visible to my client after configuration is loaded. It persists even if I call common.CustomProfileConfigProvider("", ociProfileName) multiple times.

So I am not sure if I am missing something or maybe there is a way to invalidate this cache? which currently is internal https://github.com/oracle/oci-go-sdk/blob/master/common/configuration.go#L54

Thank you

dariusbakunas avatar Mar 12 '25 13:03 dariusbakunas