GRPCProviderServer and PrepareProviderconfig
Update the server side of the plugin to match the new method signature.
This commit is contained in:
parent
155f899249
commit
a3ac49b3fb
|
@ -77,8 +77,8 @@ func (s *GRPCProviderServer) getDatasourceSchemaBlock(name string) *configschema
|
||||||
return dat.CoreConfigSchema()
|
return dat.CoreConfigSchema()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *GRPCProviderServer) ValidateProviderConfig(_ context.Context, req *proto.ValidateProviderConfig_Request) (*proto.ValidateProviderConfig_Response, error) {
|
func (s *GRPCProviderServer) PrepareProviderConfig(_ context.Context, req *proto.PrepareProviderConfig_Request) (*proto.PrepareProviderConfig_Response, error) {
|
||||||
resp := &proto.ValidateProviderConfig_Response{}
|
resp := &proto.PrepareProviderConfig_Response{}
|
||||||
|
|
||||||
block := s.getProviderSchemaBlock()
|
block := s.getProviderSchemaBlock()
|
||||||
|
|
||||||
|
@ -93,6 +93,9 @@ func (s *GRPCProviderServer) ValidateProviderConfig(_ context.Context, req *prot
|
||||||
warns, errs := s.provider.Validate(config)
|
warns, errs := s.provider.Validate(config)
|
||||||
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, convert.WarnsAndErrsToProto(warns, errs))
|
resp.Diagnostics = convert.AppendProtoDiag(resp.Diagnostics, convert.WarnsAndErrsToProto(warns, errs))
|
||||||
|
|
||||||
|
// TODO: set defaults
|
||||||
|
resp.PreparedConfig = req.Config
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue