mirror of https://github.com/helm/helm
parent
db9ab4aa4d
commit
f76a17acb4
@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/codegangsta/cli"
|
||||
"github.com/deis/helm-dm/dm"
|
||||
"github.com/deis/helm-dm/format"
|
||||
)
|
||||
|
||||
func listCmd() cli.Command {
|
||||
return cli.Command{
|
||||
Name: "list",
|
||||
Usage: "Lists the deployments in the cluster",
|
||||
Action: func(c *cli.Context) {
|
||||
if err := list(c.GlobalString("host")); err != nil {
|
||||
format.Error("%s (Is the cluster running?)", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func list(host string) error {
|
||||
client := dm.NewClient(host)
|
||||
client.Protocol = "http"
|
||||
return client.ListDeployments()
|
||||
}
|
Loading…
Reference in new issue