Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
#20 update vendor to support auto ECR login if AWS creds are set
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Bogdanov committed Jan 12, 2016
1 parent aca5dc7 commit c4e9569
Show file tree
Hide file tree
Showing 103 changed files with 11,162 additions and 4,939 deletions.
24 changes: 12 additions & 12 deletions vendor/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@
"revision": "c01cf91b011868172fdcd9f41838e80c9d716264",
"branch": "master"
},
{
"importpath": "github.com/aws/aws-sdk-go",
"repository": "https://github.com/aws/aws-sdk-go",
"revision": "d4677067b535e7a06201ce491b41f4b73dcc73a9",
"branch": "master"
},
{
"importpath": "github.com/grammarly/rocker/src/rocker/storage",
"repository": "https://github.com/grammarly/rocker",
Expand All @@ -164,18 +158,24 @@
"path": "/src/rocker/storage"
},
{
"importpath": "github.com/grammarly/rocker/src/rocker/dockerclient",
"importpath": "github.com/grammarly/rocker/src/rocker/imagename",
"repository": "https://github.com/grammarly/rocker",
"revision": "82968a0d349d1ef57d15972dbcc5fcaf3cbcccf3",
"revision": "fb14fe236b5675a3491e9c948ba01c43432252db",
"branch": "dev",
"path": "/src/rocker/dockerclient"
"path": "/src/rocker/imagename"
},
{
"importpath": "github.com/grammarly/rocker/src/rocker/imagename",
"importpath": "github.com/grammarly/rocker/src/rocker/dockerclient",
"repository": "https://github.com/grammarly/rocker",
"revision": "82968a0d349d1ef57d15972dbcc5fcaf3cbcccf3",
"revision": "fb14fe236b5675a3491e9c948ba01c43432252db",
"branch": "dev",
"path": "/src/rocker/imagename"
"path": "/src/rocker/dockerclient"
},
{
"importpath": "github.com/aws/aws-sdk-go",
"repository": "https://github.com/aws/aws-sdk-go",
"revision": "c924893c38ecc04b18d7aab8a7aa561cb8b4c4cc",
"branch": "master"
}
]
}
4 changes: 2 additions & 2 deletions vendor/src/github.com/aws/aws-sdk-go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LINTIGNOREDEPS='vendor/.+\.go'
SDK_WITH_VENDOR_PKGS=$(shell go list ./... | grep -v "/vendor/src")
SDK_ONLY_PKGS=$(shell go list ./... | grep -v "/vendor/")

all: generate unit
all: get-deps generate unit

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand Down Expand Up @@ -70,7 +70,7 @@ get-deps: get-deps-unit get-deps-integ get-deps-verify
@go get -v $(SDK_ONLY_PKGS)

get-deps-unit:
@echo "go get SDK unit testing dependancies"
@echo "go get SDK unit testing dependencies"
go get github.com/stretchr/testify
go get github.com/smartystreets/goconvey

Expand Down
7 changes: 5 additions & 2 deletions vendor/src/github.com/aws/aws-sdk-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Checkout our [release notes](https://github.com/aws/aws-sdk-go/releases) for inf

## Installing

If you are using Go 1.5 with the `GO15VENDOREXPERIMENT=1` vendoring flag you can use the following to get the SDK as the SDK's runtime dependancies are vendored in the `vendor` folder.
If you are using Go 1.5 with the `GO15VENDOREXPERIMENT=1` vendoring flag you can use the following to get the SDK as the SDK's runtime dependencies are vendored in the `vendor` folder.

$ go get -u github.com/aws/aws-sdk-go

Otherwise you'll need to tell Go to get the SDK and all of its dependancies.
Otherwise you'll need to tell Go to get the SDK and all of its dependencies.

$ go get -u github.com/aws/aws-sdk-go/...

Expand All @@ -41,6 +41,9 @@ AWS_ACCESS_KEY_ID=AKID1234567890
AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY
```

### AWS CLI config file (`~/aws/config`)
The AWS SDK for Go does not support the AWS CLI's config file. The SDK will not use any contents from this file. The SDK only supports the shared credentials file (`~/aws/credentials`). #384 tracks this feature request discussion.

## Using the Go SDK

To use a service in the SDK, create a service variable by calling the `New()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const logRespMsg = `DEBUG: Response %s/%s Details:
-----------------------------------------------------`

func logResponse(r *request.Request) {
var msg = "no reponse data"
var msg = "no response data"
if r.HTTPResponse != nil {
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody)
Expand Down
2 changes: 1 addition & 1 deletion vendor/src/github.com/aws/aws-sdk-go/aws/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go"

// SDKVersion is the version of this SDK
const SDKVersion = "1.0.3"
const SDKVersion = "1.0.8"
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build go1.5

package rename

import (
Expand All @@ -7,10 +9,10 @@ import (
"go/format"
"go/parser"
"go/token"
"go/types"
"io/ioutil"

"golang.org/x/tools/go/loader"
"golang.org/x/tools/go/types"
)

var dryRun = flag.Bool("dryrun", false, "Dry run")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// +build !go1.5

package rename

import (
"bytes"
"flag"
"fmt"
"go/format"
"go/parser"
"go/token"
"io/ioutil"

"golang.org/x/tools/go/loader"
"golang.org/x/tools/go/types"
)

var dryRun = flag.Bool("dryrun", false, "Dry run")
var verbose = flag.Bool("verbose", false, "Verbose")

type packageRenames struct {
operations map[string]string
shapes map[string]string
fields map[string]string
}

type renamer struct {
*loader.Program
files map[*token.File]bool
}

// ParsePathsFromArgs parses arguments from command line and looks at import
// paths to rename objects.
func ParsePathsFromArgs() {
flag.Parse()
for _, dir := range flag.Args() {
var conf loader.Config
conf.ParserMode = parser.ParseComments
conf.ImportWithTests(dir)
prog, err := conf.Load()
if err != nil {
panic(err)
}

r := renamer{prog, map[*token.File]bool{}}
r.parse()
if !*dryRun {
r.write()
}
}
}

func (r *renamer) dryInfo() string {
if *dryRun {
return "[DRY-RUN]"
}
return "[!]"
}

func (r *renamer) printf(msg string, args ...interface{}) {
if *verbose {
fmt.Printf(msg, args...)
}
}

func (r *renamer) parse() {
for _, pkg := range r.InitialPackages() {
r.parseUses(pkg)
}
}

func (r *renamer) write() {
for _, pkg := range r.InitialPackages() {
for _, f := range pkg.Files {
tokenFile := r.Fset.File(f.Pos())
if r.files[tokenFile] {
var buf bytes.Buffer
format.Node(&buf, r.Fset, f)
if err := ioutil.WriteFile(tokenFile.Name(), buf.Bytes(), 0644); err != nil {
panic(err)
}
}
}
}
}

func (r *renamer) parseUses(pkg *loader.PackageInfo) {
for k, v := range pkg.Uses {
if v.Pkg() != nil {
pkgPath := v.Pkg().Path()
if renames, ok := renamedPackages[pkgPath]; ok {
name := k.Name
switch t := v.(type) {
case *types.Func:
if newName, ok := renames.operations[t.Name()]; ok && newName != name {
r.printf("%s Rename [OPERATION]: %q -> %q\n", r.dryInfo(), name, newName)
r.files[r.Fset.File(k.Pos())] = true
k.Name = newName
}
case *types.TypeName:
if newName, ok := renames.shapes[name]; ok && newName != name {
r.printf("%s Rename [SHAPE]: %q -> %q\n", r.dryInfo(), t.Name(), newName)
r.files[r.Fset.File(k.Pos())] = true
k.Name = newName
}
case *types.Var:
if newName, ok := renames.fields[name]; ok && newName != name {
r.printf("%s Rename [FIELD]: %q -> %q\n", r.dryInfo(), t.Name(), newName)
r.files[r.Fset.File(k.Pos())] = true
k.Name = newName
}
}
}
}
}
}
Loading

0 comments on commit c4e9569

Please sign in to comment.