From 958d67d44493c8c9cc3f4200345824b09ff5af03 Mon Sep 17 00:00:00 2001 From: joeduffy Date: Wed, 19 Apr 2017 14:25:49 -0700 Subject: [PATCH] Move NewCheckResponse into coconut/pkg/resource package --- lib/aws/provider/ec2/instance.go | 2 +- lib/aws/provider/ec2/security_group.go | 2 +- lib/aws/provider/iam/role.go | 2 +- lib/aws/provider/lambda/function.go | 2 +- lib/aws/provider/s3/bucket.go | 2 +- lib/aws/provider/s3/object.go | 2 +- {lib/aws/provider/awsctx => pkg/resource}/check.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename {lib/aws/provider/awsctx => pkg/resource}/check.go (97%) diff --git a/lib/aws/provider/ec2/instance.go b/lib/aws/provider/ec2/instance.go index 45547482a..f2db5013b 100644 --- a/lib/aws/provider/ec2/instance.go +++ b/lib/aws/provider/ec2/instance.go @@ -55,7 +55,7 @@ func (p *instanceProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) contract.Assertf(*result.Images[0].ImageId == instance.ImageID, "Expected instance IDs to match") } - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/ec2/security_group.go b/lib/aws/provider/ec2/security_group.go index 9fab0f8de..e1897600a 100644 --- a/lib/aws/provider/ec2/security_group.go +++ b/lib/aws/provider/ec2/security_group.go @@ -39,7 +39,7 @@ func (p *sgProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) (*coc // Read in the properties, create and validate a new group, and return the failures (if any). contract.Assert(req.GetType() == string(SecurityGroup)) _, _, result := unmarshalSecurityGroup(req.GetProperties()) - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/iam/role.go b/lib/aws/provider/iam/role.go index a21dd464c..298393aea 100644 --- a/lib/aws/provider/iam/role.go +++ b/lib/aws/provider/iam/role.go @@ -40,7 +40,7 @@ func (p *roleProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) (*c // Read in the properties, create and validate a new group, and return the failures (if any). contract.Assert(req.GetType() == string(Role)) _, _, result := unmarshalRole(req.GetProperties()) - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/lambda/function.go b/lib/aws/provider/lambda/function.go index f02bc73d9..b0ab67484 100644 --- a/lib/aws/provider/lambda/function.go +++ b/lib/aws/provider/lambda/function.go @@ -44,7 +44,7 @@ func (p *funcProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) (*c // Read in the properties, create and validate a new group, and return the failures (if any). contract.Assert(req.GetType() == string(Function)) _, _, result := unmarshalFunction(req.GetProperties()) - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/s3/bucket.go b/lib/aws/provider/s3/bucket.go index 22ff5182c..60925e154 100644 --- a/lib/aws/provider/s3/bucket.go +++ b/lib/aws/provider/s3/bucket.go @@ -39,7 +39,7 @@ func (p *buckProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) (*c // Read in the properties, create and validate a new group, and return the failures (if any). contract.Assert(req.GetType() == string(Bucket)) _, _, result := unmarshalBucket(req.GetProperties()) - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/s3/object.go b/lib/aws/provider/s3/object.go index 9c2e29778..89246f84e 100644 --- a/lib/aws/provider/s3/object.go +++ b/lib/aws/provider/s3/object.go @@ -43,7 +43,7 @@ func (p *objProvider) Check(ctx context.Context, req *cocorpc.CheckRequest) (*co // Read in the properties, create and validate a new group, and return the failures (if any). contract.Assert(req.GetType() == string(Object)) _, _, result := unmarshalObject(req.GetProperties()) - return awsctx.NewCheckResponse(result), nil + return resource.NewCheckResponse(result), nil } // Name names a given resource. Sometimes this will be assigned by a developer, and so the provider diff --git a/lib/aws/provider/awsctx/check.go b/pkg/resource/check.go similarity index 97% rename from lib/aws/provider/awsctx/check.go rename to pkg/resource/check.go index 7b1f70b65..f94844b0f 100644 --- a/lib/aws/provider/awsctx/check.go +++ b/pkg/resource/check.go @@ -1,6 +1,6 @@ // Copyright 2017 Pulumi, Inc. All rights reserved. -package awsctx +package resource import ( "github.com/pulumi/coconut/pkg/util/mapper"