Skip to content

Commit

Permalink
Cleanup Context Interface Usage
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail committed Mar 30, 2020
1 parent c2af16d commit 7ddd8a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aws/credentials/ec2rolecreds/ec2_role_provider.go
Expand Up @@ -138,7 +138,7 @@ const iamSecurityCredsPath = "iam/security-credentials/"

// requestCredList requests a list of credentials from the EC2 service.
// If there are no credentials, or there is an error making or receiving the request
func requestCredList(ctx credentials.Context, client *ec2metadata.EC2Metadata) ([]string, error) {
func requestCredList(ctx aws.Context, client *ec2metadata.EC2Metadata) ([]string, error) {
resp, err := client.GetMetadataWithContext(ctx, iamSecurityCredsPath)
if err != nil {
return nil, awserr.New("EC2RoleRequestError", "no EC2 instance role found", err)
Expand All @@ -162,7 +162,7 @@ func requestCredList(ctx credentials.Context, client *ec2metadata.EC2Metadata) (
//
// If the credentials cannot be found, or there is an error reading the response
// and error will be returned.
func requestCred(ctx credentials.Context, client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
func requestCred(ctx aws.Context, client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
resp, err := client.GetMetadataWithContext(ctx, sdkuri.PathJoin(iamSecurityCredsPath, credsName))
if err != nil {
return ec2RoleCredRespBody{},
Expand Down
2 changes: 1 addition & 1 deletion aws/credentials/endpointcreds/provider.go
Expand Up @@ -154,7 +154,7 @@ type errorOutput struct {
Message string `json:"message"`
}

func (p *Provider) getCredentials(ctx credentials.Context) (*getCredentialsOutput, error) {
func (p *Provider) getCredentials(ctx aws.Context) (*getCredentialsOutput, error) {
op := &request.Operation{
Name: "GetCredentials",
HTTPMethod: "GET",
Expand Down
2 changes: 1 addition & 1 deletion aws/credentials/stscreds/assume_role_provider.go
Expand Up @@ -120,7 +120,7 @@ type AssumeRoler interface {
}

type assumeRolerWithContext interface {
AssumeRoleWithContext(credentials.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error)
AssumeRoleWithContext(aws.Context, *sts.AssumeRoleInput, ...request.Option) (*sts.AssumeRoleOutput, error)
}

// DefaultDuration is the default amount of time in minutes that the credentials
Expand Down

0 comments on commit 7ddd8a5

Please sign in to comment.