From 6c151ebcf154a492ebf4726621f90d24d26be259 Mon Sep 17 00:00:00 2001 From: Tianxin Dong Date: Thu, 5 May 2022 17:51:45 +0800 Subject: [PATCH] Fix: add some message to make debug more clear (#3812) Signed-off-by: FogDong --- references/cli/debug.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/references/cli/debug.go b/references/cli/debug.go index de8bb9078..80a2c40d2 100644 --- a/references/cli/debug.go +++ b/references/cli/debug.go @@ -82,8 +82,8 @@ func NewDebugCommand(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command }, } addNamespaceAndEnvArg(cmd) - cmd.Flags().StringVarP(&dOpts.step, "step", "s", "", "specify the step to debug") - cmd.Flags().StringVarP(&dOpts.focus, "focus", "f", "", "specify the focus value to debug") + cmd.Flags().StringVarP(&dOpts.step, "step", "s", "", "specify the step or component to debug") + cmd.Flags().StringVarP(&dOpts.focus, "focus", "f", "", "specify the focus value to debug, only valid for application with workflow") return cmd } @@ -255,7 +255,7 @@ func unwrapStepName(step string) string { func (d *debugOpts) getDebugRawValue(ctx context.Context, cli client.Client, pd *packages.PackageDiscover, app *v1beta1.Application) (*value.Value, error) { debugCM := &corev1.ConfigMap{} if err := cli.Get(ctx, client.ObjectKey{Name: debug.GenerateContextName(app.Name, d.step), Namespace: app.Namespace}, debugCM); err != nil { - return nil, fmt.Errorf("failed to get debug configmap: %w", err) + return nil, fmt.Errorf("failed to get debug configmap, please make sure your application have the debug policy, you can add the debug policy by using `vela up -f --debug`: %w", err) } if debugCM.Data == nil || debugCM.Data["debug"] == "" {