Skip to content

Commit

Permalink
Bump crossplane-runtime
Browse files Browse the repository at this point in the history
This commit fixes crossplane-contrib#802

Signed-off-by: Nic Cope <negz@rk0n.org>
  • Loading branch information
negz committed Oct 12, 2021
1 parent 079a7ed commit d2abd6f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/acm/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex
if err != nil {
return managed.ExternalCreation{}, awsclient.Wrap(err, errCreate)
}
meta.SetExternalName(cr, awsclient.StringValue(response.CertificateArn))
meta.SetExternalName(cr, aws.ToString(response.CertificateArn))
return managed.ExternalCreation{}, nil

}
Expand Down
19 changes: 19 additions & 0 deletions pkg/controller/ec2/vpc/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,25 @@ func TestCreate(t *testing.T) {
want
}{
"Successful": {
args: args{
vpc: &fake.MockVPCClient{
MockCreate: func(ctx context.Context, input *awsec2.CreateVpcInput, opts []func(*awsec2.Options)) (*awsec2.CreateVpcOutput, error) {
return &awsec2.CreateVpcOutput{
Vpc: &awsec2types.Vpc{
VpcId: aws.String(vpcID),
CidrBlock: aws.String(cidr),
},
}, nil
},
},
cr: vpc(),
},
want: want{
cr: vpc(withExternalName(vpcID)),
result: managed.ExternalCreation{},
},
},
"SuccessfulWithAttributes": {
args: args{
vpc: &fake.MockVPCClient{
MockCreate: func(ctx context.Context, input *awsec2.CreateVpcInput, opts []func(*awsec2.Options)) (*awsec2.CreateVpcOutput, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/identity/iamaccesskey/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex
}
}
meta.SetExternalName(cr, aws.ToString(response.AccessKey.AccessKeyId))
return managed.ExternalCreation{ExternalNameAssigned: true, ConnectionDetails: conn}, nil
return managed.ExternalCreation{ConnectionDetails: conn}, nil
}

func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/identity/iamaccesskey/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func TestCreate(t *testing.T) {
withUsername(userName),
withAccessKey(accessKeyID)),
result: managed.ExternalCreation{
ExternalNameAssigned: true,

ConnectionDetails: map[string][]byte{
xpv1.ResourceCredentialsSecretPasswordKey: []byte(secretKeyID),
xpv1.ResourceCredentialsSecretUserKey: []byte(accessKeyID),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func TestCreate(t *testing.T) {
withSpecGroupName(groupName),
withSpecPolicyArn(policyArn),
withExternalName(groupName+"/"+policyArn)),
result: managed.ExternalCreation{},
},
},
"InValidInput": {
Expand Down
3 changes: 1 addition & 2 deletions pkg/controller/identity/openidconnectprovider/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

"github.com/aws/aws-sdk-go-v2/aws"
awsiam "github.com/aws/aws-sdk-go-v2/service/iam"
awsgo "github.com/aws/aws-sdk-go/aws"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/pkg/errors"
Expand Down Expand Up @@ -144,7 +143,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex
return managed.ExternalCreation{}, awsclient.Wrap(err, errCreate)
}

meta.SetExternalName(cr, awsgo.StringValue(observed.OpenIDConnectProviderArn))
meta.SetExternalName(cr, aws.ToString(observed.OpenIDConnectProviderArn))
return managed.ExternalCreation{}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func TestCreate(t *testing.T) {
cr: oidcProvider(withURL(url), func(provider *svcapitypes.OpenIDConnectProvider) {
meta.SetExternalName(provider, providerArn)
}),
result: managed.ExternalCreation{},
},
},
}
Expand Down

0 comments on commit d2abd6f

Please sign in to comment.