Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit dc0982b

Browse files
committed
update integration's auth method
1 parent 484bc00 commit dc0982b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

integration-cli/docker_utils.go

100755100644
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/docker/go-connections/sockets"
3737
"github.com/docker/go-connections/tlsconfig"
3838
"github.com/go-check/check"
39+
"github.com/hyperhq/hypercli/cliconfig"
3940
)
4041

4142
var flag_host = ""
@@ -636,8 +637,12 @@ func newRequestClient(method, endpoint string, data io.Reader, ct string) (*http
636637
req.Header.Set("Content-Type", ct)
637638
}
638639

640+
region := os.Getenv("REGION")
641+
if region == "" {
642+
region = cliconfig.DefaultHyperRegion
643+
}
639644
//calculate sign4 for apirouter
640-
req = HyperCli.Sign4(os.Getenv("ACCESS_KEY"), os.Getenv("SECRET_KEY"), req)
645+
req = HyperCli.Sign4(os.Getenv("ACCESS_KEY"), os.Getenv("SECRET_KEY"), req, region)
641646

642647
//for debug
643648
if endpoint == debugEndpoint {
@@ -850,7 +855,7 @@ func deleteAllFips() error {
850855
return err
851856
}
852857

853-
for _, v := range strings.Split(fips,"\n") {
858+
for _, v := range strings.Split(fips, "\n") {
854859
if v == "" {
855860
continue
856861
}

0 commit comments

Comments
 (0)