diff --git a/cmd/helm/chart_upload.go b/cmd/helm/chart_upload.go index f46ef2c94..a6a18a22a 100644 --- a/cmd/helm/chart_upload.go +++ b/cmd/helm/chart_upload.go @@ -93,7 +93,7 @@ func doUpload(filename, cname string, cxt *cli.Context) (string, error) { return "", nil } - c := client(cxt) + c := NewClient(cxt) return c.PostChart(filename, cname) } diff --git a/cmd/helm/delete.go b/cmd/helm/delete.go index 6eeb42e4f..5aaa39c7f 100644 --- a/cmd/helm/delete.go +++ b/cmd/helm/delete.go @@ -42,7 +42,7 @@ func deleteDeployment(c *cli.Context) error { return errors.New("First argument, deployment name, is required. Try 'helm get --help'") } name := args[0] - deployment, err := client(c).DeleteDeployment(name) + deployment, err := NewClient(c).DeleteDeployment(name) if err != nil { return err } diff --git a/cmd/helm/deploy.go b/cmd/helm/deploy.go index 129ca75f1..c6042dba7 100644 --- a/cmd/helm/deploy.go +++ b/cmd/helm/deploy.go @@ -102,7 +102,7 @@ func deploy(c *cli.Context) error { } } - return client(c).PostDeployment(cfg) + return NewClient(c).PostDeployment(cfg) } // isLocalChart returns true if the given path can be statted. diff --git a/cmd/helm/dm.go b/cmd/helm/dm.go index cf21cb16f..6a9b349f6 100644 --- a/cmd/helm/dm.go +++ b/cmd/helm/dm.go @@ -21,7 +21,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/kubernetes/deployment-manager/pkg/dm" + "github.com/kubernetes/deployment-manager/pkg/client" "github.com/kubernetes/deployment-manager/pkg/format" "github.com/kubernetes/deployment-manager/pkg/kubectl" ) @@ -133,7 +133,7 @@ func dmCmd() cli.Command { func install(dryRun bool, ebImg, manImg, resImg string) error { runner := getKubectlRunner(dryRun) - i := dm.NewInstaller() + i := client.NewInstaller() i.Manager["Image"] = manImg i.Resourcifier["Image"] = resImg i.Expandybird["Image"] = ebImg @@ -149,7 +149,7 @@ func install(dryRun bool, ebImg, manImg, resImg string) error { func uninstall(dryRun bool) error { runner := getKubectlRunner(dryRun) - out, err := dm.Uninstall(runner) + out, err := client.Uninstall(runner) if err != nil { format.Err("Error uninstalling: %s %s", out, err) } diff --git a/cmd/helm/doctor.go b/cmd/helm/doctor.go index c89eb40b2..f3214e332 100644 --- a/cmd/helm/doctor.go +++ b/cmd/helm/doctor.go @@ -18,7 +18,7 @@ package main import ( "github.com/codegangsta/cli" - "github.com/kubernetes/deployment-manager/pkg/dm" + "github.com/kubernetes/deployment-manager/pkg/client" "github.com/kubernetes/deployment-manager/pkg/format" "github.com/kubernetes/deployment-manager/pkg/kubectl" ) @@ -39,7 +39,7 @@ func doctorCmd() cli.Command { func doctor(c *cli.Context) error { var runner kubectl.Runner runner = &kubectl.RealRunner{} - if dm.IsInstalled(runner) { + if client.IsInstalled(runner) { format.Success("You have everything you need. Go forth my friend!") } else { format.Warning("Looks like you don't have DM installed.\nRun: `helm install`") diff --git a/cmd/helm/get.go b/cmd/helm/get.go index 61f5cda84..a07fa7c87 100644 --- a/cmd/helm/get.go +++ b/cmd/helm/get.go @@ -42,7 +42,7 @@ func get(c *cli.Context) error { return errors.New("First argument, deployment name, is required. Try 'helm get --help'") } name := args[0] - deployment, err := client(c).GetDeployment(name) + deployment, err := NewClient(c).GetDeployment(name) if err != nil { return err } diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index 8cecb2c01..3b26984ab 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -20,7 +20,7 @@ import ( "os" "github.com/codegangsta/cli" - "github.com/kubernetes/deployment-manager/pkg/dm" + "github.com/kubernetes/deployment-manager/pkg/client" ) var version = "0.0.1" @@ -78,9 +78,9 @@ func run(c *cli.Context, f func(c *cli.Context) error) { } } -func client(c *cli.Context) *dm.Client { +func NewClient(c *cli.Context) *client.Client { host := c.GlobalString("host") debug := c.GlobalBool("debug") timeout := c.GlobalInt("timeout") - return dm.NewClient(host).SetDebug(debug).SetTimeout(timeout) + return client.NewClient(host).SetDebug(debug).SetTimeout(timeout) } diff --git a/cmd/helm/list.go b/cmd/helm/list.go index cc2d231a6..108f7b2c6 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -34,7 +34,7 @@ func listCmd() cli.Command { } func list(c *cli.Context) error { - list, err := client(c).ListDeployments() + list, err := NewClient(c).ListDeployments() if err != nil { return err } diff --git a/pkg/dm/client.go b/pkg/client/client.go similarity index 99% rename from pkg/dm/client.go rename to pkg/client/client.go index 9b52f933b..6aa8183ad 100644 --- a/pkg/dm/client.go +++ b/pkg/client/client.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "encoding/json" diff --git a/pkg/dm/client_test.go b/pkg/client/client_test.go similarity index 99% rename from pkg/dm/client_test.go rename to pkg/client/client_test.go index 41942bf05..3843f047f 100644 --- a/pkg/dm/client_test.go +++ b/pkg/client/client_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "fmt" diff --git a/pkg/dm/install.go b/pkg/client/install.go similarity index 99% rename from pkg/dm/install.go rename to pkg/client/install.go index 7c7cae8f5..4bd67ae52 100644 --- a/pkg/dm/install.go +++ b/pkg/client/install.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "bytes" diff --git a/pkg/dm/transport.go b/pkg/client/transport.go similarity index 99% rename from pkg/dm/transport.go rename to pkg/client/transport.go index 2e1c4aa3c..dc304990a 100644 --- a/pkg/dm/transport.go +++ b/pkg/client/transport.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "fmt" diff --git a/pkg/dm/transport_test.go b/pkg/client/transport_test.go similarity index 99% rename from pkg/dm/transport_test.go rename to pkg/client/transport_test.go index de9f04477..bae83c056 100644 --- a/pkg/dm/transport_test.go +++ b/pkg/client/transport_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "bytes" diff --git a/pkg/dm/uninstall.go b/pkg/client/uninstall.go similarity index 98% rename from pkg/dm/uninstall.go rename to pkg/client/uninstall.go index 8b3224195..475c37c49 100644 --- a/pkg/dm/uninstall.go +++ b/pkg/client/uninstall.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package dm +package client import ( "github.com/kubernetes/deployment-manager/pkg/kubectl"