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

Add resources (steps) info in workload get#99

Merged
rashedkvm merged 4 commits into
vmware-tanzu:mainfrom
warango4:issue61
May 12, 2022
Merged

Add resources (steps) info in workload get#99
rashedkvm merged 4 commits into
vmware-tanzu:mainfrom
warango4:issue61

Conversation

@warango4
Copy link
Copy Markdown
Contributor

@warango4 warango4 commented May 5, 2022

Pull request

What this PR does / why we need it

Adding resource info in workload get command. There is a list which shows the name of each resource, its status and its age.
The status is taken from the condition of the resource which type is 'Ready'.

According to Cartographer:

Conditions describing this resource's reconcile state. The top level condition is of type Ready, and follows these Kubernetes conventions:
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties

There are going to be some follow up commits changing the current output of workload get command.
One to display supply chain info and other to display issues in workload

Which issue(s) this PR fixes

Fixes #61

Describe testing done for PR

  • Testing in local cluster
  • Added unit tests

Additional information or special notes for your reviewer

IMPORTANT NOTE:
Current Carto's release version does not support the Conditions field in workloads' resources.
To test this PR, you'll need to install Cartographer from their main branch.

  • First, make sure your coreutils are installed, because the script will need realpath, which comes within. To do so, you can simply type brew install coreutils .

  • Clone Carto's repo (https://github.com/vmware-tanzu/cartographer) and go to the branch you need to install it from.

  • Export the following variables

    • REGISTRY, which needs to point to the registry the image is going to be published on.
      Ex: $ export REGISTRY=gcr.io/tanzu-framework-playground/test/carto-test

    • RELEASE_VERSION, you can set this to make sure Carto's version installed in your cluster is the one you're expecting.
      Ex: $ export RELEASE_VERSION=v0.5.0 (current Carto official released version is 0.3.0)

    • DOCKER_CONFIG, which needs to point to your docker config json file.
      A way to check where this file is, is using $ gcloud auth configure-docker , which will show where the config.json file is in the system
      Ex: $ export DOCKER_CONFIG=/Users/wendyarango/.docker
      Note: do not add to the path the name of the file, in this case config.json, because it will induce an error. Just use the path to the folder where the file is.

  • Inside Carto's folder, run the following
    $ ./hack/setup.sh cartographer

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

@warango4
Copy link
Copy Markdown
Contributor Author

warango4 commented May 5, 2022

image

@warango4
Copy link
Copy Markdown
Contributor Author

warango4 commented May 5, 2022

image

@warango4
Copy link
Copy Markdown
Contributor Author

warango4 commented May 5, 2022

image

@atmandhol atmandhol requested review from rashedkvm and shashwathi May 5, 2022 21:29
@warango4 warango4 changed the title Add resources (steps) info in workload workload get Add resources (steps) info in workload get May 5, 2022
Copy link
Copy Markdown
Contributor

@shashwathi shashwathi left a comment

Choose a reason for hiding this comment

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

Something to think about

  • If a resource doesnt have conditions set, should we print them or ignore them?
  • If we choose to print, then what is the Ready string suppose to have?

Comment thread pkg/printer/workload_source_printer_test.go Outdated
Adding resource info in workload get command. There is a list which shows the name of each resource, its status and its age.
The status is taken from the condition of the resource which type is 'Ready'.

According to Cartographer:
'Conditions describing this resource's reconcile
state. The top level condition is of type `Ready`, and follows
these Kubernetes conventions:
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties'

There are going to be some follow up commits changing the current output of workload get command.
One to display supply chain info and other to display issues in workload

Signed-off-by: Wendy Arango <warango@vmware.com>
@warango4 warango4 marked this pull request as ready for review May 9, 2022 17:02
@warango4 warango4 requested a review from shashwathi May 9, 2022 17:02
Comment thread pkg/printer/workload_source_printer_test.go
Comment thread pkg/printer/workload_source_printer_test.go
Comment thread pkg/commands/workload_get_test.go
Comment thread pkg/commands/workload_get_test.go
Comment thread pkg/printer/workload_source_printer.go Outdated
Comment thread pkg/apis/cartographer/v1alpha1/workload.go Outdated
Comment thread pkg/commands/workload_get.go
Comment thread pkg/commands/workload_get_test.go Outdated
Comment thread pkg/printer/workload_source_printer.go Outdated
Comment thread pkg/commands/workload_get.go Outdated
Comment thread pkg/commands/workload_get_test.go
@warango4 warango4 requested review from rashedkvm and shashwathi May 11, 2022 16:05
@rashedkvm rashedkvm merged commit 9c288f5 into vmware-tanzu:main May 12, 2022
warango4 pushed a commit to warango4/apps-cli-plugin that referenced this pull request May 17, 2022
In this feat, the way the workload status used to be displayed changes to show specifically the supply chain info (name) and the workload status on its Ready condition.
If there is no supply chain reference, but there is a Ready condition that surfaces the workload status, on row "name", `<none>` is going to be displayed.
If there is no Ready condition, but a supply chain reference, then rows "ready" and "last update" are left blank.
If there are no conditions and no supply chain reference, a message indicating this situation is displayed.

Follow-up of PR vmware-tanzu#99 for issue vmware-tanzu#61

Signed-off-by: Wendy Arango <warango@vmware.com>
warango4 pushed a commit to warango4/apps-cli-plugin that referenced this pull request May 17, 2022
In this feat, the way the workload status used to be displayed changes to show specifically the supply chain info (name) and the workload status on its Ready condition.
If there is no supply chain reference, but there is a Ready condition that surfaces the workload status, on row "name", `<none>` is going to be displayed.
If there is no Ready condition, but a supply chain reference, then rows "ready" and "last update" are left blank.
If there are no conditions and no supply chain reference, a message indicating this situation is displayed.

Follow-up of PR vmware-tanzu#99 for issue vmware-tanzu#61

Signed-off-by: Wendy Arango <warango@vmware.com>
warango4 pushed a commit to warango4/apps-cli-plugin that referenced this pull request May 17, 2022
In this feat, the way the workload status used to be displayed changes to show specifically the supply chain info (name) and the workload status on its Ready condition.
If there is no supply chain reference, but there is a Ready condition that surfaces the workload status, on row "name", `<none>` is going to be displayed.
If there is no Ready condition, but a supply chain reference, then rows "ready" and "last update" are left blank.
If there are no conditions and no supply chain reference, a message indicating this situation is displayed.

Follow-up of PR vmware-tanzu#99 for issue vmware-tanzu#61

Signed-off-by: Wendy Arango <warango@vmware.com>
warango4 pushed a commit to warango4/apps-cli-plugin that referenced this pull request May 17, 2022
In this feat, the way the workload status used to be displayed changes to show specifically the supply chain info (name) and the workload status on its Ready condition.
If there is no supply chain reference, but there is a Ready condition that surfaces the workload status, on row "name", `<none>` is going to be displayed.
If there is no Ready condition, but a supply chain reference, then rows "ready" and "last update" are left blank.
If there are no conditions and no supply chain reference, a message indicating this situation is displayed.

Follow-up of PR vmware-tanzu#99 for issue vmware-tanzu#61

Signed-off-by: Wendy Arango <warango@vmware.com>
@warango4 warango4 deleted the issue61 branch July 14, 2022 13:52
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.

Add supply chain status information to workload get

5 participants