mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Improve logging of global provider schema cache hits. (#766)
Signed-off-by: Jakub Martin <kubam@spacelift.io>
This commit is contained in:
@@ -12,14 +12,15 @@ import (
|
||||
"github.com/zclconf/go-cty/cty"
|
||||
|
||||
plugin "github.com/hashicorp/go-plugin"
|
||||
ctyjson "github.com/zclconf/go-cty/cty/json"
|
||||
"github.com/zclconf/go-cty/cty/msgpack"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/opentofu/opentofu/internal/addrs"
|
||||
"github.com/opentofu/opentofu/internal/logging"
|
||||
"github.com/opentofu/opentofu/internal/plugin/convert"
|
||||
"github.com/opentofu/opentofu/internal/providers"
|
||||
proto "github.com/opentofu/opentofu/internal/tfplugin5"
|
||||
ctyjson "github.com/zclconf/go-cty/cty/json"
|
||||
"github.com/zclconf/go-cty/cty/msgpack"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
var logger = logging.HCLogger()
|
||||
@@ -81,6 +82,7 @@ func (p *GRPCProvider) GetProviderSchema() (resp providers.GetProviderSchemaResp
|
||||
// check the global cache
|
||||
if !p.Addr.IsZero() {
|
||||
if resp, ok := providers.SchemaCache.Get(p.Addr); ok {
|
||||
logger.Trace("GRPCProvider: GetProviderSchema: serving from global schema cache", "address", p.Addr)
|
||||
return resp
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user