apps-cli-plugin
apps-cli-plugin copied to clipboard
Provide same info when adding -o json or -o yaml flag to workload get command
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
Not migrated because this will not be addressed by carto v1 and with v2 which supports an infinite number of workload types and it's not clear we'll be able to reliably retrieve a URL if/when it exists. If we learn this isn't the case for carto v2, we can move this over.