Merge pull request #463 from michelleN/helm-describe

feat(deployment): add describe command to helm cli
pull/465/merge
Michelle Noorali 9 years ago
commit 27678bcb09

@ -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 deploymentDesc = `A deployment is an instance of a Chart running in the cluster.
@ -69,6 +72,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.",
@ -137,6 +146,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