Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --output flag in clustersupplychain list/get #517

Closed
warango4 opened this issue Mar 21, 2023 · 1 comment
Closed

Add --output flag in clustersupplychain list/get #517

warango4 opened this issue Mar 21, 2023 · 1 comment
Labels
Milestone

Comments

@warango4
Copy link
Contributor

Description of problem

Proposed solution

Given I have some supply chains in my cluster
When I run `tanzu apps csc get my-suppply-chain --output yaml` or `tanzu apps csc list --output yaml` 
Then I get the output of the supply chain in yaml format
Given I have some supply chains in my cluster
When I run `tanzu apps csc get my-suppply-chain --output json` or `tanzu apps csc list --output json` 
Then I get the output of the supply chain in json format

Example

tanzu apps csc get basic-image-to-url -oyaml
apiVersion: carto.run/v1alpha1
kind: ClusterSupplyChain
metadata:
...
  name: basic-image-to-url
  resourceVersion: "1711559"
  uid: 60a044c7-0af3-4a2e-847b-bdf40f690d9a
spec:
  params:
  - default: main
    name: gitops_branch
  - default: supplychain
    name: gitops_user_name
  - default: supplychain
    name: gitops_user_email
  - default: supplychain@cluster.local
    name: gitops_commit_message
  - default: ""
    name: gitops_ssh_secret
  resources:
 ...
  - configs:
    - name: config
      resource: config-provider
    name: app-config
    templateRef:
      kind: ClusterConfigTemplate
      options:
      - name: config-template
        selector:
          matchLabels:
            apps.tanzu.vmware.com/workload-type: web
      - name: server-template
        selector:
          matchLabels:
            apps.tanzu.vmware.com/workload-type: server
      - name: worker-template
        selector:
          matchLabels:
            apps.tanzu.vmware.com/workload-type: worker
...
  selectorMatchExpressions:
  - key: apps.tanzu.vmware.com/workload-type
    operator: In
    values:
    - web
    - server
    - worker
  selectorMatchFields:
  - key: spec.image
    operator: Exists
status:
...
tanzu apps csc get basic-image-to-url -ojson
{
    "apiVersion": "carto.run/v1alpha1",
    "kind": "ClusterSupplyChain",
    "metadata": {
...
        "name": "basic-image-to-url",
        "resourceVersion": "1711559",
        "uid": "60a044c7-0af3-4a2e-847b-bdf40f690d9a"
    },
    "spec": {
        "params": [
           ...
        ],
        "resources": [
            {
                "name": "image-provider",
                "params": [
                    {
                        "default": "default",
                        "name": "serviceAccount"
                    }
                ],
                "templateRef": {
                    "kind": "ClusterImageTemplate",
                    "name": "image-provider-template"
                }
            },
           ...
            {
                ...
                "templateRef": {
                    "kind": "ClusterConfigTemplate",
                    "options": [
                        {
                            "name": "config-template",
                            "selector": {
                                "matchLabels": {
                                    "apps.tanzu.vmware.com/workload-type": "web"
                                }
                            }
                        },
                       ...
                    ]
                }
            },
            ...
        ],
        "selectorMatchExpressions": [
            {
                "key": "apps.tanzu.vmware.com/workload-type",
                "operator": "In",
                "values": [
                    "web",
                    "server",
                    "worker"
                ]
            }
        ],
    },
    "status": {
        ...
}

Describe alternatives you've considered

Use -o as shorthand for --output

Additional context

Behaviour should be similar to workload get -o yaml/json and workload list -o yaml/json

@atmandhol atmandhol added this to the 0.13.0 milestone May 22, 2023
@heyjcollins
Copy link
Contributor

This is a nice-to-have feature that hasn't been explicitly requested by end-users.
Because we'll be creating a new supply-chain plugin to LCM supply chains and the current version of supply chains will be deprecated, we've made a decision against investing in this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants