Skip to content

Commit

Permalink
docs: update cli documentation & README
Browse files Browse the repository at this point in the history
  • Loading branch information
dhenkel92 committed Dec 6, 2023
1 parent 5405050 commit 1ab7a98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ Usage:
Available Commands:
completion Generate the autocompletion script for the specified shell
cover Shows which PDBs are covering the given workload.
create
cover Shows which PDBs are a workload.
create Create a new PDB for a given workload.
help Help about any command
pods List pods
pods List pods covered by a given PDB
Flags:
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
Expand Down Expand Up @@ -106,12 +106,12 @@ kubectl pdb pods <pdb_name>

List all PDBs for all pods of a namespace:
```
kubectl pdb cover -n <namespace>
kubectl pdb cover -n <namespace> [pod_name]
```

List all PDBs for a specific pod:
Create new PDB:
```
kubectl pdb cover -n <namespace> <pod_name>
kubectl pdb create <resource_type>/<resource_name> --dry-run -o yaml
```

## Contributing
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/create_pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ func NewCmdCreatePDB(streams genericclioptions.IOStreams, conf genericclioptions
o := NewCreatePDBOptions(streams, conf)

cmd := &cobra.Command{
Use: "create",
Use: "create",
Short: "Create a new PDB for a given workload.",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return fmt.Errorf("Please pass a pod name")
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ func NewCmdPdb(streams genericclioptions.IOStreams, conf genericclioptions.RESTC
o := NewPDBOptions(streams, conf)

cmd := &cobra.Command{
Use: "cover [pod name]",
Short: "Shows which PDBs are covering the given workload.",
Use: "cover [pod_name]",
Short: "Shows which PDBs are a workload.",
RunE: func(cmd *cobra.Command, args []string) error {
if err := o.Complete(cmd, args); err != nil {
return err
Expand Down
5 changes: 2 additions & 3 deletions pkg/cmd/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ func NewCmdPods(streams genericclioptions.IOStreams, conf *genericclioptions.Con
o := NewPodsOptions(streams, conf)

cmd := &cobra.Command{
Use: "pods [pdb name]",
Short: "List pods",
Long: "List pods",
Use: "pods <pdb_name>",
Short: "List pods covered by a given PDB",
RunE: func(cmd *cobra.Command, args []string) error {
if err := o.Complete(cmd, args); err != nil {
return err
Expand Down

0 comments on commit 1ab7a98

Please sign in to comment.