Skip to content

Commit f2b2459

Browse files
feat(*): update controller-go-sdk (#87)
1 parent 772dd53 commit f2b2459

6 files changed

Lines changed: 18 additions & 17 deletions

File tree

cmd/auth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99
"syscall"
1010

11-
client "github.com/deis/controller-sdk-go"
11+
deis "github.com/deis/controller-sdk-go"
1212
"github.com/deis/controller-sdk-go/auth"
1313
"github.com/deis/workflow-cli/settings"
1414
"golang.org/x/crypto/ssh/terminal"
@@ -18,7 +18,7 @@ import (
1818
func Register(controller string, username string, password string, email string,
1919
sslVerify bool) error {
2020

21-
c, err := client.New(sslVerify, controller, "", "")
21+
c, err := deis.New(sslVerify, controller, "", "")
2222

2323
if err != nil {
2424
return err
@@ -76,7 +76,7 @@ func Register(controller string, username string, password string, email string,
7676
return doLogin(c, username, password)
7777
}
7878

79-
func doLogin(c *client.Client, username, password string) error {
79+
func doLogin(c *deis.Client, username, password string) error {
8080
token, err := auth.Login(c, username, password)
8181
if checkAPICompatibility(c, err) != nil {
8282
return err
@@ -97,7 +97,7 @@ func doLogin(c *client.Client, username, password string) error {
9797

9898
// Login to a Deis controller.
9999
func Login(controller string, username string, password string, sslVerify bool) error {
100-
c, err := client.New(sslVerify, controller, "", "")
100+
c, err := deis.New(sslVerify, controller, "", "")
101101

102102
if err != nil {
103103
return err

cmd/certs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func CertAdd(cert string, key string, name string) error {
117117
return nil
118118
}
119119

120-
func doCertAdd(c *client.Client, cert string, key string, name string) error {
120+
func doCertAdd(c *deis.Client, cert string, key string, name string) error {
121121
certFile, err := ioutil.ReadFile(cert)
122122
if err != nil {
123123
return err

cmd/perms.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func PermDelete(appID string, username string, admin bool) error {
9898
return nil
9999
}
100100

101-
func permsLoad(appID string, admin bool) (*client.Client, string, error) {
101+
func permsLoad(appID string, admin bool) (*deis.Client, string, error) {
102102
c, err := settings.Load()
103103

104104
if err != nil {

cmd/utils.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"strings"
77
"time"
88

9-
client "github.com/deis/controller-sdk-go"
9+
deis "github.com/deis/controller-sdk-go"
1010
"github.com/deis/workflow-cli/pkg/git"
1111
"github.com/deis/workflow-cli/settings"
1212
)
@@ -54,7 +54,7 @@ func chooseColor(input string) string {
5454
return fmt.Sprintf("\033[3%dm", color)
5555
}
5656

57-
func load(appID string) (*client.Client, string, error) {
57+
func load(appID string) (*deis.Client, string, error) {
5858
c, err := settings.Load()
5959

6060
if err != nil {
@@ -92,12 +92,12 @@ func limitCount(objs, total int) string {
9292

9393
// checkAPICompatibility handles specific behavior for certain errors,
9494
// such as printing an warning for the API mismatch error
95-
func checkAPICompatibility(c *client.Client, err error) error {
96-
if err == client.ErrAPIMismatch {
95+
func checkAPICompatibility(c *deis.Client, err error) error {
96+
if err == deis.ErrAPIMismatch {
9797
fmt.Printf(`! WARNING: Client and server API versions do not match. Please consider upgrading.
9898
! Client version: %s
9999
! Server version: %s
100-
`, client.APIVersion, c.ControllerAPIVersion)
100+
`, deis.APIVersion, c.ControllerAPIVersion)
101101

102102
// API mismatch isn't fatal, so after warning continue on.
103103
return nil

glide.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/settings.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"os"
88
"path/filepath"
99

10-
client "github.com/deis/controller-sdk-go"
10+
deis "github.com/deis/controller-sdk-go"
1111
"github.com/deis/workflow-cli/version"
1212
)
1313

@@ -23,7 +23,7 @@ type settingsFile struct {
2323
}
2424

2525
// Load loads a new client from a settings file.
26-
func Load() (*client.Client, error) {
26+
func Load() (*deis.Client, error) {
2727
filename := locateSettingsFile()
2828

2929
if _, err := os.Stat(filename); err != nil {
@@ -44,7 +44,7 @@ func Load() (*client.Client, error) {
4444
return nil, err
4545
}
4646

47-
c, err := client.New(settings.VerifySSL, settings.Controller, settings.Token, settings.Username)
47+
c, err := deis.New(settings.VerifySSL, settings.Controller, settings.Token, settings.Username)
4848

4949
if err != nil {
5050
return nil, err
@@ -62,7 +62,7 @@ func Load() (*client.Client, error) {
6262
}
6363

6464
// Save settings to a file
65-
func Save(c *client.Client) error {
65+
func Save(c *deis.Client) error {
6666
settings := settingsFile{Username: c.Username, VerifySSL: c.VerifySSL,
6767
Controller: c.ControllerURL.String(), Token: c.Token, Limit: c.ResponseLimit}
6868

0 commit comments

Comments
 (0)