Merge pull request #364 from adamreese/fix/dm-rename-client

ref(client): rename pkg/dm to pkg/client
pull/368/head
Adam Reese 9 years ago
commit fb08885110

@ -93,7 +93,7 @@ func doUpload(filename, cname string, cxt *cli.Context) (string, error) {
return "", nil return "", nil
} }
c := client(cxt) c := NewClient(cxt)
return c.PostChart(filename, cname) return c.PostChart(filename, cname)
} }

@ -42,7 +42,7 @@ func deleteDeployment(c *cli.Context) error {
return errors.New("First argument, deployment name, is required. Try 'helm get --help'") return errors.New("First argument, deployment name, is required. Try 'helm get --help'")
} }
name := args[0] name := args[0]
deployment, err := client(c).DeleteDeployment(name) deployment, err := NewClient(c).DeleteDeployment(name)
if err != nil { if err != nil {
return err return err
} }

@ -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. // isLocalChart returns true if the given path can be statted.

@ -21,7 +21,7 @@ import (
"os" "os"
"github.com/codegangsta/cli" "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/format"
"github.com/kubernetes/deployment-manager/pkg/kubectl" "github.com/kubernetes/deployment-manager/pkg/kubectl"
) )
@ -133,7 +133,7 @@ func dmCmd() cli.Command {
func install(dryRun bool, ebImg, manImg, resImg string) error { func install(dryRun bool, ebImg, manImg, resImg string) error {
runner := getKubectlRunner(dryRun) runner := getKubectlRunner(dryRun)
i := dm.NewInstaller() i := client.NewInstaller()
i.Manager["Image"] = manImg i.Manager["Image"] = manImg
i.Resourcifier["Image"] = resImg i.Resourcifier["Image"] = resImg
i.Expandybird["Image"] = ebImg i.Expandybird["Image"] = ebImg
@ -149,7 +149,7 @@ func install(dryRun bool, ebImg, manImg, resImg string) error {
func uninstall(dryRun bool) error { func uninstall(dryRun bool) error {
runner := getKubectlRunner(dryRun) runner := getKubectlRunner(dryRun)
out, err := dm.Uninstall(runner) out, err := client.Uninstall(runner)
if err != nil { if err != nil {
format.Err("Error uninstalling: %s %s", out, err) format.Err("Error uninstalling: %s %s", out, err)
} }

@ -18,7 +18,7 @@ package main
import ( import (
"github.com/codegangsta/cli" "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/format"
"github.com/kubernetes/deployment-manager/pkg/kubectl" "github.com/kubernetes/deployment-manager/pkg/kubectl"
) )
@ -39,7 +39,7 @@ func doctorCmd() cli.Command {
func doctor(c *cli.Context) error { func doctor(c *cli.Context) error {
var runner kubectl.Runner var runner kubectl.Runner
runner = &kubectl.RealRunner{} runner = &kubectl.RealRunner{}
if dm.IsInstalled(runner) { if client.IsInstalled(runner) {
format.Success("You have everything you need. Go forth my friend!") format.Success("You have everything you need. Go forth my friend!")
} else { } else {
format.Warning("Looks like you don't have DM installed.\nRun: `helm install`") format.Warning("Looks like you don't have DM installed.\nRun: `helm install`")

@ -42,7 +42,7 @@ func get(c *cli.Context) error {
return errors.New("First argument, deployment name, is required. Try 'helm get --help'") return errors.New("First argument, deployment name, is required. Try 'helm get --help'")
} }
name := args[0] name := args[0]
deployment, err := client(c).GetDeployment(name) deployment, err := NewClient(c).GetDeployment(name)
if err != nil { if err != nil {
return err return err
} }

@ -20,7 +20,7 @@ import (
"os" "os"
"github.com/codegangsta/cli" "github.com/codegangsta/cli"
"github.com/kubernetes/deployment-manager/pkg/dm" "github.com/kubernetes/deployment-manager/pkg/client"
) )
var version = "0.0.1" 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") host := c.GlobalString("host")
debug := c.GlobalBool("debug") debug := c.GlobalBool("debug")
timeout := c.GlobalInt("timeout") timeout := c.GlobalInt("timeout")
return dm.NewClient(host).SetDebug(debug).SetTimeout(timeout) return client.NewClient(host).SetDebug(debug).SetTimeout(timeout)
} }

@ -34,7 +34,7 @@ func listCmd() cli.Command {
} }
func list(c *cli.Context) error { func list(c *cli.Context) error {
list, err := client(c).ListDeployments() list, err := NewClient(c).ListDeployments()
if err != nil { if err != nil {
return err return err
} }

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"encoding/json" "encoding/json"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"fmt" "fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"bytes" "bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"fmt" "fmt"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"bytes" "bytes"

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package dm package client
import ( import (
"github.com/kubernetes/deployment-manager/pkg/kubectl" "github.com/kubernetes/deployment-manager/pkg/kubectl"
Loading…
Cancel
Save