Skip to content

Commit

Permalink
PR feedback: adjust help message to better reflect command capabiliti…
Browse files Browse the repository at this point in the history
…es and requirements

Signed-off-by: Piotr Zaniewski <piotr@upbound.io>
  • Loading branch information
Piotr1215 committed Jan 22, 2024
1 parent 49ce22d commit 98c15f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/crank/beta/beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Cmd struct {
// Subcommands and flags will appear in the CLI help output in the same
// order they're specified here. Keep them in alphabetical order.
Render render.Cmd `cmd:"" help:"Render a composite resource (XR)."`
Top top.Cmd `cmd:"" help:"Top provides a dynamic real-time view of resources consumption by Crossplane pods."`
Top top.Cmd `cmd:"" help:"Display resource (CPU/memory) usage by Crossplane related pods."`
Trace trace.Cmd `cmd:"" help:"Trace a Crossplane resource to get a detailed output of its relationships, helpful for troubleshooting."`
XPKG xpkg.Cmd `cmd:"" help:"Manage Crossplane packages."`
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/crank/beta/top/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (c *Cmd) Help() string {
return `
This command returns current resources utilization (CPU and Memory) by Crossplane pods.
Similar to kubectl top pods, it requires Metrics Server to be correctly configured and working on the server.
Examples:
# Show resources utilization for all Crossplane pods in the default 'crossplane-system' namespace in a tabular format.
crossplane beta top
Expand Down Expand Up @@ -136,6 +138,7 @@ func (c *Cmd) Run(k *kong.Context, logger logging.Logger) error { //nolint:gocyc
return errors.Wrap(err, errFetchAllPods)
}

// TODO:(piotr1215) if there are no crossplane pods found we should pring message and exit gracefully
crossplanePods := getCrossplanePods(pods.Items)
logger.Debug("Fetched all pods from and filtered out Crossplane", "pods", crossplanePods, "namespace", c.Namespace)

Expand Down

0 comments on commit 98c15f5

Please sign in to comment.