Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoNamespaceSpecified chkitErrors.Err = "no namespace specified"
)
View Source
var GetDeployment = &cli.Command{ Name: "deployment", Aliases: []string{"depl", "deployments", "deploy"}, Usage: "shows deployment data", ArgsUsage: "namespace [deployment_names ...]", Action: func(ctx *cli.Context) error { if ctx.Bool("help") { return cli.ShowSubcommandHelp(ctx) } client := util.GetClient(ctx) defer util.StoreClient(ctx, client) var show model.Renderer switch ctx.NArg() { case 0: namespace := util.GetNamespace(ctx) logrus.Debugf("getting deployment from %q", namespace) list, err := client.GetDeploymentList(namespace) if err != nil { return err } show = list default: namespace := util.GetNamespace(ctx) deplNames := newSet(ctx.Args().Slice()) var showList deployment.DeploymentList = make([]deployment.Deployment, 0) // prevents panic list, err := client.GetDeploymentList(namespace) if err != nil { return err } for _, depl := range list { if deplNames.Contain(depl.Name) { showList = append(showList, depl) } } show = showList } return util.WriteData(ctx, show) }, Flags: []cli.Flag{ &cli.StringFlag{ Name: "file", Aliases: []string{"f"}, }, &cli.StringFlag{ Name: "output", Aliases: []string{"o"}, }, }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.