Add route53 plugin (#1390)

* Update vendor

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Add route53 plugin

This fix adds route53 plugin so that it is possible to
query route53 record through CoreDNS.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2018-01-15 09:59:29 -08:00 committed by GitHub
parent d699b89063
commit 584dd87c70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
352 changed files with 81636 additions and 1798 deletions

View file

@ -0,0 +1,40 @@
package shareddefaults
import (
"os"
"path/filepath"
"runtime"
)
// SharedCredentialsFilename returns the SDK's default file path
// for the shared credentials file.
//
// Builds the shared config file path based on the OS's platform.
//
// - Linux/Unix: $HOME/.aws/credentials
// - Windows: %USERPROFILE%\.aws\credentials
func SharedCredentialsFilename() string {
return filepath.Join(UserHomeDir(), ".aws", "credentials")
}
// SharedConfigFilename returns the SDK's default file path for
// the shared config file.
//
// Builds the shared config file path based on the OS's platform.
//
// - Linux/Unix: $HOME/.aws/config
// - Windows: %USERPROFILE%\.aws\config
func SharedConfigFilename() string {
return filepath.Join(UserHomeDir(), ".aws", "config")
}
// UserHomeDir returns the home directory for the user the process is
// running under.
func UserHomeDir() string {
if runtime.GOOS == "windows" { // Windows
return os.Getenv("USERPROFILE")
}
// *nix
return os.Getenv("HOME")
}

View file

@ -0,0 +1,40 @@
package shareddefaults_test
import (
"os"
"path/filepath"
"testing"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/internal/shareddefaults"
)
func TestSharedCredsFilename(t *testing.T) {
env := awstesting.StashEnv()
defer awstesting.PopEnv(env)
os.Setenv("HOME", "home_dir")
os.Setenv("USERPROFILE", "profile_dir")
expect := filepath.Join("home_dir", ".aws", "credentials")
name := shareddefaults.SharedCredentialsFilename()
if e, a := expect, name; e != a {
t.Errorf("expect %q shared creds filename, got %q", e, a)
}
}
func TestSharedConfigFilename(t *testing.T) {
env := awstesting.StashEnv()
defer awstesting.PopEnv(env)
os.Setenv("HOME", "home_dir")
os.Setenv("USERPROFILE", "profile_dir")
expect := filepath.Join("home_dir", ".aws", "config")
name := shareddefaults.SharedConfigFilename()
if e, a := expect, name; e != a {
t.Errorf("expect %q shared config filename, got %q", e, a)
}
}

View file

@ -0,0 +1,40 @@
package shareddefaults_test
import (
"os"
"path/filepath"
"testing"
"github.com/aws/aws-sdk-go/awstesting"
"github.com/aws/aws-sdk-go/internal/shareddefaults"
)
func TestSharedCredsFilename(t *testing.T) {
env := awstesting.StashEnv()
defer awstesting.PopEnv(env)
os.Setenv("HOME", "home_dir")
os.Setenv("USERPROFILE", "profile_dir")
expect := filepath.Join("profile_dir", ".aws", "credentials")
name := shareddefaults.SharedCredentialsFilename()
if e, a := expect, name; e != a {
t.Errorf("expect %q shared creds filename, got %q", e, a)
}
}
func TestSharedConfigFilename(t *testing.T) {
env := awstesting.StashEnv()
defer awstesting.PopEnv(env)
os.Setenv("HOME", "home_dir")
os.Setenv("USERPROFILE", "profile_dir")
expect := filepath.Join("profile_dir", ".aws", "config")
name := shareddefaults.SharedConfigFilename()
if e, a := expect, name; e != a {
t.Errorf("expect %q shared config filename, got %q", e, a)
}
}