feat(deployment): add describe command to helm cli

pull/463/head
Michelle Noorali 9 years ago
parent f7e66da9ee
commit 5aedea16c5

@ -26,7 +26,10 @@ import (
"github.com/kubernetes/helm/pkg/format"
)
var errMissingDeploymentArg = errors.New("First argument, deployment name, is required. Try 'helm get --help'")
var (
errMissingDeploymentArg = errors.New("First argument, deployment name, is required. Try 'helm get --help'")
errTooManyArgs = errors.New("Too many arguments provided. Try 'helm dep describe [DEPLOYMENT]'")
)
const defaultShowFormat = `Name: {{.Name}}
Status: {{.State.Status}}
@ -57,6 +60,12 @@ func deploymentCommands() cli.Command {
ArgsUsage: "DEPLOYMENT [DEPLOYMENT [...]]",
Action: func(c *cli.Context) { run(c, deleteDeployment) },
},
{
Name: "describe",
Usage: "Describes the kubernetes resources for the named deployment(s).",
ArgsUsage: "DEPLOYMENT",
Action: func(c *cli.Context) { run(c, describeDeployment) },
},
{
Name: "manifest",
Usage: "Dump the Kubernetes manifest file for this deployment.",
@ -125,6 +134,25 @@ func deleteDeployment(c *cli.Context) error {
return nil
}
func describeDeployment(c *cli.Context) error {
args := c.Args()
if len(args) < 1 {
return errMissingDeploymentArg
}
if len(args) > 1 {
return errTooManyArgs
}
name := args[0]
_, err := NewClient(c).DescribeDeployment(name)
if err != nil {
return err
}
format.Info("TO BE IMPLEMENTED")
return nil
}
func showDeployment(c *cli.Context) error {
args := c.Args()
if len(args) < 1 {

@ -100,6 +100,13 @@ func (c *Client) DeleteDeployment(name string) (*common.Deployment, error) {
return deployment, err
}
// DescribDeployment describes the kubernetes resources of the supplied deployment
func (c *Client) DescribeDeployment(name string) (*common.Deployment, error) {
var deployment *common.Deployment
//TODO: implement
return deployment, nil
}
// PostDeployment posts a deployment object to the manager service.
func (c *Client) PostDeployment(res *common.Resource) error {
// This is a stop-gap until we get this API cleaned up.

Loading…
Cancel
Save