MCPcopy
hub / github.com/opentofu/opentofu / GetProviderSchema

Method GetProviderSchema

internal/plugin6/grpc_provider.go:97–110  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

95var _ providers.Interface = new(GRPCProvider)
96
97func (p *GRPCProvider) GetProviderSchema(ctx context.Context) (resp providers.GetProviderSchemaResponse) {
98 logger.Trace("GRPCProvider.v6: GetProviderSchema")
99
100 schema := p.SchemaCache(func() providers.GetProviderSchemaResponse {
101 return p.getProviderSchema(ctx)
102 })
103
104 if !p.hasFetchedSchema && !schema.ServerCapabilities.GetProviderSchemaOptional {
105 // Force call, we only care that we are satisfying the legacy provider's schema call request
106 _, _ = p.getProtoProviderSchema(ctx)
107 }
108
109 return schema
110}
111
112func (p *GRPCProvider) getProviderSchema(ctx context.Context) (resp providers.GetProviderSchemaResponse) {
113 resp.ResourceTypes = make(map[string]providers.Schema)

Callers 15

UpgradeResourceStateMethod · 0.95
ConfigureProviderMethod · 0.95
ReadResourceMethod · 0.95
PlanResourceChangeMethod · 0.95
ApplyResourceChangeMethod · 0.95
ImportResourceStateMethod · 0.95
MoveResourceStateMethod · 0.95

Calls 2

getProviderSchemaMethod · 0.95

Tested by

no test coverage detected