Skip to content

Commit

Permalink
Merge pull request #6380 from ROunofF/cluster-autoscaler-release-1.27
Browse files Browse the repository at this point in the history
[cluster-autoscaler-1.27] Update cloudprovider/aws/aws-sdk-go to 1.48.7
  • Loading branch information
k8s-ci-robot authored Dec 18, 2023
2 parents 0946f84 + 673de10 commit d218e48
Show file tree
Hide file tree
Showing 2,925 changed files with 1,742,421 additions and 1,862,166 deletions.
7 changes: 4 additions & 3 deletions cluster-autoscaler/cloudprovider/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,14 @@ To refresh static list, please run `go run ec2_instance_types/gen.go` under

If you want to use a newer version of the AWS SDK than the version currently vendored as a direct dependency by Cluster Autoscaler, then you can use the version vendored under this AWS cloudprovider.

The current version vendored is `v1.44.24`.
The current version vendored is `v1.48.7`.

If you want to update the vendored AWS SDK to a newer version, please make sure of the following:

1. Place the copy of the new desired version of the AWS SDK under the `aws-sdk-go` directory.
2. Update the import statements within the newly-copied AWS SDK to reference the new paths (e.g., `github.com/aws/aws-sdk-go/aws/awsutil` -> `k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil`).
3. Update the version number above to indicate the new vendored version.
2. Remove folders : models and examples. Remove _test.go file `find . -name '*_test.go' -exec rm {}+`
3. Update the import statements within the newly-copied AWS SDK to reference the new paths (e.g., `github.com/aws/aws-sdk-go/aws/awsutil` -> `k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awsutil`). You can use this command from the aws-sdk-go folder `find . -type f -exec sed -i ‘s#github.com/aws/aws-sdk-go#k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go#’ {} \;`
4. Update the version number above to indicate the new vendored version.

## Using cloud config with helm

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "6b25cc1a-38cf-4e22-9728-e8e169b9152b",
"type": "feature",
"description": "Add awsQueryCompatible error code translation support",
"modules": [
"."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "6eb0ebeb-e73b-422a-969e-a440174c3e83",
"type": "bugfix",
"description": "Removes old model file for ssm sap and uses the new model file to regenerate client",
"modules": [
"."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "74c9af99-629e-453b-97a0-af6251efd414",
"type": "bugfix",
"description": "endpoints were incorrect for kendra-ranking. this fixes that",
"modules": [
"."
]
}
11 changes: 11 additions & 0 deletions cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dist
/doc
/doc-staging
.yardoc
Gemfile.lock
awstesting/integration/smoke/**/importmarker__.go
awstesting/integration/smoke/_test/
/vendor/bin/
/vendor/pkg/
/vendor/src/
/private/model/cli/gen-api/gen-api
14 changes: 14 additions & 0 deletions cluster-autoscaler/cloudprovider/aws/aws-sdk-go/.godoc_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"PkgHandler": {
"Pattern": "/sdk-for-go/api/",
"StripPrefix": "/sdk-for-go/api",
"Include": ["/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/service"],
"Exclude": ["/src/cmd", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awstesting", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/awsmigrate", "/src/k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/private"],
"IgnoredSuffixes": ["iface"]
},
"Github": {
"Tag": "master",
"Repo": "/aws/aws-sdk-go",
"UseGithub": true
}
}
132 changes: 0 additions & 132 deletions cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/arn/arn_test.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package bearer

import (
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws"
"time"
)

// Token provides a type wrapping a bearer token and expiration metadata.
type Token struct {
Value string

CanExpire bool
Expires time.Time
}

// Expired returns if the token's Expires time is before or equal to the time
// provided. If CanExpire is false, Expired will always return false.
func (t Token) Expired(now time.Time) bool {
if !t.CanExpire {
return false
}
now = now.Round(0)
return now.Equal(t.Expires) || now.After(t.Expires)
}

// TokenProvider provides interface for retrieving bearer tokens.
type TokenProvider interface {
RetrieveBearerToken(aws.Context) (Token, error)
}

// TokenProviderFunc provides a helper utility to wrap a function as a type
// that implements the TokenProvider interface.
type TokenProviderFunc func(aws.Context) (Token, error)

// RetrieveBearerToken calls the wrapped function, returning the Token or
// error.
func (fn TokenProviderFunc) RetrieveBearerToken(ctx aws.Context) (Token, error) {
return fn(ctx)
}

// StaticTokenProvider provides a utility for wrapping a static bearer token
// value within an implementation of a token provider.
type StaticTokenProvider struct {
Token Token
}

// RetrieveBearerToken returns the static token specified.
func (s StaticTokenProvider) RetrieveBearerToken(aws.Context) (Token, error) {
return s.Token, nil
}
80 changes: 41 additions & 39 deletions cluster-autoscaler/cloudprovider/aws/aws-sdk-go/aws/awserr/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@ package awserr
//
// Example:
//
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if awsErr, ok := err.(awserr.Error); ok {
// // Get error details
// log.Println("Error:", awsErr.Code(), awsErr.Message())
//
// // Prints out full error message, including original error if there was one.
// log.Println("Error:", awsErr.Error())
//
// // Get original error
// if origErr := awsErr.OrigErr(); origErr != nil {
// // operate on original error.
// }
// } else {
// fmt.Println(err.Error())
// }
// }
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if awsErr, ok := err.(awserr.Error); ok {
// // Get error details
// log.Println("Error:", awsErr.Code(), awsErr.Message())
//
// // Prints out full error message, including original error if there was one.
// log.Println("Error:", awsErr.Error())
//
// // Get original error
// if origErr := awsErr.OrigErr(); origErr != nil {
// // operate on original error.
// }
// } else {
// fmt.Println(err.Error())
// }
// }
//
type Error interface {
// Satisfy the generic error interface.
error
Expand Down Expand Up @@ -99,31 +100,32 @@ func NewBatchError(code, message string, errs []error) BatchedErrors {
//
// Example:
//
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if reqerr, ok := err.(RequestFailure); ok {
// log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID())
// } else {
// log.Println("Error:", err.Error())
// }
// }
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if reqerr, ok := err.(RequestFailure); ok {
// log.Println("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID())
// } else {
// log.Println("Error:", err.Error())
// }
// }
//
// Combined with awserr.Error:
//
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if awsErr, ok := err.(awserr.Error); ok {
// // Generic AWS Error with Code, Message, and original error (if any)
// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
//
// if reqErr, ok := err.(awserr.RequestFailure); ok {
// // A service error occurred
// fmt.Println(reqErr.StatusCode(), reqErr.RequestID())
// }
// } else {
// fmt.Println(err.Error())
// }
// }
// output, err := s3manage.Upload(svc, input, opts)
// if err != nil {
// if awsErr, ok := err.(awserr.Error); ok {
// // Generic AWS Error with Code, Message, and original error (if any)
// fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
//
// if reqErr, ok := err.(awserr.RequestFailure); ok {
// // A service error occurred
// fmt.Println(reqErr.StatusCode(), reqErr.RequestID())
// }
// } else {
// fmt.Println(err.Error())
// }
// }
//
type RequestFailure interface {
Error

Expand Down
Loading

0 comments on commit d218e48

Please sign in to comment.