Update aws-sdk-go to 1.1.2 release

This commit is contained in:
Chris Bednarski 2016-02-12 16:17:46 -08:00
parent fafcda541f
commit 115426becb
7 changed files with 60 additions and 35 deletions

32
Godeps/Godeps.json generated
View File

@ -13,43 +13,43 @@
},
{
"ImportPath": "github.com/aws/aws-sdk-go/aws",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/endpoints",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/signer/v4",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/private/waiter",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/s3",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/aws/aws-sdk-go/service/sts",
"Comment": "v1.1.0-15-ga170e9c",
"Rev": "a170e9cb76475a0da7c0326a13cc2b39e9244b3b"
"Comment": "v1.1.2",
"Rev": "8041be5461786460d86b4358305fbdf32d37cfb2"
},
{
"ImportPath": "github.com/bgentry/speakeasy",

View File

@ -64,9 +64,6 @@ type BatchError interface {
// If origErr satisfies the Error interface it will not be wrapped within a new
// Error object and will instead be returned.
func New(code, message string, origErr error) Error {
if e, ok := origErr.(Error); ok && e != nil {
return e
}
return newBaseError(code, message, origErr)
}

View File

@ -30,6 +30,11 @@ type validator struct {
errors []string
}
// There's no validation to be done on the contents of []byte values. Prepare
// to check validateAny arguments against that type so we can quickly skip
// them.
var byteSliceType = reflect.TypeOf([]byte(nil))
// validateAny will validate any struct, slice or map type. All validations
// are also performed recursively for nested types.
func (v *validator) validateAny(value reflect.Value, path string) {
@ -42,6 +47,10 @@ func (v *validator) validateAny(value reflect.Value, path string) {
case reflect.Struct:
v.validateStruct(value, path)
case reflect.Slice:
if value.Type() == byteSliceType {
// We don't need to validate the contents of []byte.
return
}
for i := 0; i < value.Len(); i++ {
v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i))
}

View File

@ -132,7 +132,7 @@ const iamSecurityCredsPath = "/iam/security-credentials"
func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
resp, err := client.GetMetadata(iamSecurityCredsPath)
if err != nil {
return nil, awserr.New("EC2RoleRequestError", "failed to list EC2 Roles", err)
return nil, awserr.New("EC2RoleRequestError", "no EC2 instance role found", err)
}
credsList := []string{}
@ -142,7 +142,7 @@ func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
}
if err := s.Err(); err != nil {
return nil, awserr.New("SerializationError", "failed to read list of EC2 Roles", err)
return nil, awserr.New("SerializationError", "failed to read EC2 instance role from metadata service", err)
}
return credsList, nil
@ -157,7 +157,7 @@ func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCred
if err != nil {
return ec2RoleCredRespBody{},
awserr.New("EC2RoleRequestError",
fmt.Sprintf("failed to get %s EC2 Role credentials", credsName),
fmt.Sprintf("failed to get %s EC2 instance role credentials", credsName),
err)
}
@ -165,7 +165,7 @@ func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCred
if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil {
return ec2RoleCredRespBody{},
awserr.New("SerializationError",
fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName),
fmt.Sprintf("failed to decode %s EC2 instance role credentials", credsName),
err)
}

View File

@ -3,7 +3,9 @@
package ec2metadata
import (
"io/ioutil"
"bytes"
"errors"
"io"
"net/http"
"time"
@ -91,23 +93,28 @@ type metadataOutput struct {
func unmarshalHandler(r *request.Request) {
defer r.HTTPResponse.Body.Close()
b, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
b := &bytes.Buffer{}
if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {
r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err)
return
}
data := r.Data.(*metadataOutput)
data.Content = string(b)
if data, ok := r.Data.(*metadataOutput); ok {
data.Content = b.String()
}
}
func unmarshalError(r *request.Request) {
defer r.HTTPResponse.Body.Close()
_, err := ioutil.ReadAll(r.HTTPResponse.Body)
if err != nil {
b := &bytes.Buffer{}
if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil {
r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err)
return
}
// TODO extract the error...
// Response body format is not consistent between metadata endpoints.
// Grab the error message as a string and include that as the source error
r.Error = awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String()))
}
func validateEndpointHandler(r *request.Request) {

View File

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK
const SDKVersion = "1.1.0"
const SDKVersion = "1.1.2"

View File

@ -476,6 +476,9 @@ const opGetBucketLifecycle = "GetBucketLifecycle"
// GetBucketLifecycleRequest generates a request for the GetBucketLifecycle operation.
func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *request.Request, output *GetBucketLifecycleOutput) {
if c.Client.Config.Logger != nil {
c.Client.Config.Logger.Log("This operation, GetBucketLifecycle, has been deprecated")
}
op := &request.Operation{
Name: opGetBucketLifecycle,
HTTPMethod: "GET",
@ -585,6 +588,9 @@ const opGetBucketNotification = "GetBucketNotification"
// GetBucketNotificationRequest generates a request for the GetBucketNotification operation.
func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfigurationDeprecated) {
if c.Client.Config.Logger != nil {
c.Client.Config.Logger.Log("This operation, GetBucketNotification, has been deprecated")
}
op := &request.Operation{
Name: opGetBucketNotification,
HTTPMethod: "GET",
@ -1191,6 +1197,9 @@ const opPutBucketLifecycle = "PutBucketLifecycle"
// PutBucketLifecycleRequest generates a request for the PutBucketLifecycle operation.
func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *request.Request, output *PutBucketLifecycleOutput) {
if c.Client.Config.Logger != nil {
c.Client.Config.Logger.Log("This operation, PutBucketLifecycle, has been deprecated")
}
op := &request.Operation{
Name: opPutBucketLifecycle,
HTTPMethod: "PUT",
@ -1281,6 +1290,9 @@ const opPutBucketNotification = "PutBucketNotification"
// PutBucketNotificationRequest generates a request for the PutBucketNotification operation.
func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (req *request.Request, output *PutBucketNotificationOutput) {
if c.Client.Config.Logger != nil {
c.Client.Config.Logger.Log("This operation, PutBucketNotification, has been deprecated")
}
op := &request.Operation{
Name: opPutBucketNotification,
HTTPMethod: "PUT",
@ -1828,7 +1840,7 @@ type CloudFunctionConfiguration struct {
CloudFunction *string `type:"string"`
// Bucket event for which to send notifications.
Event *string `type:"string" enum:"Event"`
Event *string `deprecated:"true" type:"string" enum:"Event"`
Events []*string `locationName:"Event" type:"list" flattened:"true"`
@ -5390,7 +5402,7 @@ type QueueConfigurationDeprecated struct {
_ struct{} `type:"structure"`
// Bucket event for which to send notifications.
Event *string `type:"string" enum:"Event"`
Event *string `deprecated:"true" type:"string" enum:"Event"`
Events []*string `locationName:"Event" type:"list" flattened:"true"`
@ -5758,7 +5770,7 @@ type TopicConfigurationDeprecated struct {
_ struct{} `type:"structure"`
// Bucket event for which to send notifications.
Event *string `type:"string" enum:"Event"`
Event *string `deprecated:"true" type:"string" enum:"Event"`
Events []*string `locationName:"Event" type:"list" flattened:"true"`