GRPCProviderServer and PrepareProviderconfig

Update the server side of the plugin to match the new method signature.
This commit is contained in:
James Bardin 2018-10-17 21:30:04 -04:00
parent 155f899249
commit a3ac49b3fb
1 changed files with 5 additions and 2 deletions

View File

@ -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
} }