apps-cli-plugin icon indicating copy to clipboard operation
apps-cli-plugin copied to clipboard

Provide same info when adding -o json or -o yaml flag to workload get command

Open heyjcollins opened this issue 2 years ago • 1 comments

Description of problem

When it exists, the URL to the running workload is included in tanzu apps workload get.... output. However, the URL isn't included in the output if the user runs that command with -o json/yaml.

Proposed solution

show the url that is included in the workload get command i.e. the last line in the output

Given workload A has been created, and a knative service has been successfully created
When I run `tanzu apps workload get A -o json (or yaml)`
Then I can see the URL in the output

Example

# tanzu-java-web-app: Ready
---
lastTransitionTime: "2022-02-12T04:45:10Z"
message: ""
reason: Ready
status: "True"
type: Ready

Workload pods
NAME                                                   STATUS      RESTARTS   AGE
tanzu-java-web-app-00002-deployment-7465d4848f-8s5k5   Running     0          5d22h
tanzu-java-web-app-build-1-build-pod                   Succeeded   0          6d2h
tanzu-java-web-app-config-writer-n5csw-pod             Succeeded   0          6d2h
tanzu-java-web-app-config-writer-s8d2j-pod             Succeeded   0          5d22h

Workload Knative Services
NAME                 READY   URL
tanzu-java-web-app   Ready   http://tanzu-java-web-app.default.usability-testing.tlc.dev/

But this URL and the pods is not visible when using -o json or -o yaml which is the way we normally consume this command

Alternatives considered

The alternative would be for us to use the k8s API to fetch that information manually, but I think that if this info is already fetched and aggregated by the CLI it would be great if we could use it

Additional context

Ideally we would like to provide users with an agnostic reachable url, independent of knative if that's how their cluster is setup

originally reported by @suarezjulian

heyjcollins avatar Mar 17 '22 02:03 heyjcollins