vmware-tanzu / apps-cli-plugin

Apps Plugin for the Tanzu CLI
Apache License 2.0
18 stars 16 forks source link

tail seems to fail if workload name includes `.` char #663

Open heyjcollins opened 10 months ago

heyjcollins commented 10 months ago

Describe the bug

tanzu apps workload tail throws an error if there are periods ('.') in the workload name

$ tanzu apps workload tail -n official ucp.ucp-package.lever-v2 --timestamp --since 1h --verbose 10
Usage:
  tanzu apps workload tail <name> [flags]

Examples:
  tanzu apps workload tail my-workload
tanzu apps workload tail my-workload --since 1h

Flags:
      --component name   workload component name (e.g. build)
  -h, --help             help for tail
  -n, --namespace name   kubernetes namespace (defaulted from kube config)
      --since duration   time duration to start reading logs from (default 1m0s)
  -t, --timestamp        print timestamp for each log line

Global Flags:
      --context name      name of the kubeconfig context to use (default is current-context defined by kubeconfig)
      --kubeconfig file   kubeconfig file (default is $HOME/.kube/config)
      --no-color          deactivate color, bold, and emoji output
  -v, --verbose int32     number for the log level verbosity (default 1)

Error: name: Invalid value: "ucp.ucp-package.lever-v2"

NOTE: Let's keep this validation in place for tanzu apps workload create/apply... but remove it for all other tanzu apps workload... sub-commands.

Expected behavior

The tail command should...tail the logs successfully

Steps to Reproduce

  1. use kubectl to create a workload with a period in the name, e.g. workload.name
  2. run tanzu apps workload tail workload.name --timestamp --since 1h

Screenshots

If applicable, add screenshots to help explain your proble