Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

[backport release-0.25 branch]Add support for "tanzu cluster get" to show tree view of cluster for … #3087

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Aug 5, 2022

…TKGS

  • It would be best effort to show the treeview of the cluster object for TKGS provider
    because the older TKGS versions supports different CAPI version causing the clusterctl
    describe library unable to query/list the clsuter objects. So if clusterctl library
    successfully query the objects the treeview would be shown.
    Signed-off-by: Prem Kumar Kalle pkalle@vmware.com

Signed-off-by: Prem Kumar Kalle pkalle@vmware.com

What this PR does / why we need it

This PR adds support for "tanzu cluster get" command to show details (tree view) for TKGS

Which issue(s) this PR fixes

Fixes #1063

Describe testing done for PR

Tested with version of TKGS that has CAPI version v1alpha3 , it didn't show the cluster resources details(tree view). If user wants to know why it is not being shown, using log verbose level 1 or higher would show the warning message

❯ tanzu cluster get guestcluster1 -n gctest
  NAME           NAMESPACE  STATUS   CONTROLPLANE  WORKERS  KUBERNETES                       ROLES   TKR
  guestcluster1  gctest     running  1/1           2/2      v1.20.12+vmware.1-tkg.1.10b2767  <none>  v1.20.12---vmware.1-tkg.1.10b2767
❯ tanzu cluster get guestcluster1 -n gctest -v 1
  NAME           NAMESPACE  STATUS   CONTROLPLANE  WORKERS  KUBERNETES                       ROLES   TKR
  guestcluster1  gctest     running  1/1           2/2      v1.20.12+vmware.1-tkg.1.10b2767  <none>  v1.20.12---vmware.1-tkg.1.10b2767


  Warning! Unable to get cluster ObjectTree/cluster objects, so detailed(tree) view of cluster resources is not available!!

Tested with with version of TKGS that has CAPI version v1beta1 and it successfully shown the cluster resources details(tree view)

❯ tanzu cluster list
  NAME          NAMESPACE  STATUS    CONTROLPLANE  WORKERS  KUBERNETES        ROLES   PLAN  TKR
  test01        ns01       deleting  1/1                    v1.23.8+vmware.2  <none>        v1.23.8---vmware.2-tkg.1-zshippable
  test02        ns01       running   1/1           1/1      v1.23.8+vmware.2  <none>        v1.23.8---vmware.2-tkg.2-zshippable
  tkc-e2e-2wj4  ns01       running   1/1           1/1      v1.23.8+vmware.2  <none>        v1.23.8---vmware.2-tkg.2-zshippable
  tkc-e2e-keaf  ns01       running   1/1           1/1      v1.23.8+vmware.2  <none>        v1.23.8---vmware.2-tkg.1-zshippable
❯ tanzu cluster get test02 -n ns01
  NAME    NAMESPACE  STATUS   CONTROLPLANE  WORKERS  KUBERNETES        ROLES   TKR
  test02  ns01       running  1/1           1/1      v1.23.8+vmware.2  <none>  v1.23.8---vmware.2-tkg.2-zshippable


Details:

NAME                                                    READY  SEVERITY  REASON  SINCE  MESSAGE
/test02                                                 True                     4h42m
├─ClusterInfrastructure - VSphereCluster/test02-xvgl8   True                     4h45m
├─ControlPlane - KubeadmControlPlane/test02-dn8n2       True                     4h42m
│ └─Machine/test02-dn8n2-xvnck                          True                     4h42m
└─Workers
  └─MachineDeployment/test02-node-pool-1-2xmrf          True                     4h39m
    └─Machine/test02-node-pool-1-2xmrf-5bfc945cb-rrkqr  True                     4h40m

Release note

Adds support for "tanzu cluster get" command to show details (tree view) for TKGS

Additional information

Special notes for your reviewer

@prkalle prkalle requested review from a team as code owners August 5, 2022 14:50
@prkalle prkalle requested review from vuil and anujc25 August 5, 2022 14:51
@prkalle prkalle added area/cli kind/enhancement Categorizes issue or PR as related to an enhancement labels Aug 5, 2022
@github-actions
Copy link

github-actions bot commented Aug 5, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3087/20220805150052/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@codecov
Copy link

codecov bot commented Aug 5, 2022

Codecov Report

❗ No coverage uploaded for pull request base (release-0.25@5003fae). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 47ee172 differs from pull request most recent head 6358333. Consider uploading reports for the commit 6358333 to get more accurate results

@@               Coverage Diff               @@
##             release-0.25    #3087   +/-   ##
===============================================
  Coverage                ?   44.12%           
===============================================
  Files                   ?      416           
  Lines                   ?    42164           
  Branches                ?        0           
===============================================
  Hits                    ?    18603           
  Misses                  ?    21844           
  Partials                ?     1717           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@pallavijaini8075 pallavijaini8075 added the ok-to-merge PRs should be labelled with this before merging label Aug 6, 2022
@anujc25 anujc25 force-pushed the fix/release026/tkgs_cluster_treeview branch 2 times, most recently from 6754895 to 6358333 Compare August 8, 2022 16:15
…TKGS

- It would be best effort to show the treeview of the cluster object for TKGS provider
 because the older TKGS versions supports different CAPI version causing the clusterctl
 describe library unable to query/list the clsuter objects. So if clusterctl library
 successfully query the objects the treeview would be shown.
Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
@anujc25 anujc25 merged commit c4548a8 into vmware-tanzu:release-0.25 Aug 8, 2022
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3087/20220808162418/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3087/20220808162438/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/cli cla-not-required kind/enhancement Categorizes issue or PR as related to an enhancement ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants