Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Adding yml to accepted output formats#77

Merged
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
warango4:issue72
Apr 19, 2022
Merged

Adding yml to accepted output formats#77
rashedkvm merged 1 commit into
vmware-tanzu:mainfrom
warango4:issue72

Conversation

@warango4
Copy link
Copy Markdown
Contributor

Pull request

What this PR does / why we need it

Add support for yml extension when user wants to output a resource through workload get or workload list commands.

Output will be same if user wants to show it with yaml format.

Usage example:
tanzu apps workload get my-workload -oyml
tanzu apps workload list -oyml

Which issue(s) this PR fixes

Fixes #72

Describe testing done for PR

  • Unit testing in source code
  • Used commands in local cluster

Additional information or special notes for your reviewer

Signed-off by: Wendy Arango warango@vmware.com

Add support for yml extension when user wants to output a resource through workload get or workload list commands.

Output will be same if user wants to show it with yaml format.

Usage example:
tanzu apps workload get my-workload -oyml
tanzu apps workload list -oyml

Signed-off by: Wendy Arango warango@vmware.com
Copy link
Copy Markdown
Contributor

@odinnordico odinnordico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rashedkvm rashedkvm merged commit 4375793 into vmware-tanzu:main Apr 19, 2022
@warango4 warango4 deleted the issue72 branch April 20, 2022 14:47
@heyjcollins
Copy link
Copy Markdown
Contributor

Acceptance

tanzu apps workload get

  • workload get my-app -o yml && workload get my-app -o yaml
    • confirmed yaml returned with no additional content
    • validated yaml is syntactically correct
  • workload get my-app -o json
    • confirmed json returned with no additional content
    • validated json is syntactically correct
  • workload get misnamed-app -o yml && workload get misnamed-app -o yaml && workload get misnamed-app -o json
    • confirmed correct error message returned (not as yaml/json)
      Workload "default/misnamed-app" not found
      Error: exit status 1
      
      ✖  exit status 1
      

tanzu apps workload list

  • workload list -o yml && workload list -o yaml
    • confirmed yaml returned with no additional content
    • validated yaml is syntactically correct
  • workload list -o json
    • confirmed json returned with no additional content
    • validated json is syntactically correct
  • workload list -o yml -n wrong-namespace && workload get misnamed-app -o yaml && workload get misnamed-app -o json
    • validated yaml returned is empty and syntactically valid
      ---
      []
      
    • validated json returned is empty and syntactically valid
      []
      

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workload get -o and workload list -o accepts yaml and/or yml

5 participants