Turn on helper/schema proto5 flag in GetSchema

This turns it on at the last moment, and in one place for all uses of
helper/schema. There's no way to use the new protocol without calling
GetSchema, so we can be sure that any subsequent api calls have this set
when required.
This commit is contained in:
James Bardin 2019-02-04 19:12:20 -05:00
parent 55b4307767
commit 58c9c2311a
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ type GRPCProviderServer struct {
}
func (s *GRPCProviderServer) GetSchema(_ context.Context, req *proto.GetProviderSchema_Request) (*proto.GetProviderSchema_Response, error) {
// Here we are certain that the provider is being called through grpc, so
// make sure the feature flag for helper/schema is set
schema.SetProto5()
resp := &proto.GetProviderSchema_Response{
ResourceSchemas: make(map[string]*proto.Schema),
DataSourceSchemas: make(map[string]*proto.Schema),