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

Add support to list clusterclass based clusters on TKGs #2886

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Jul 8, 2022

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

What this PR does / why we need it

This PR adds supports to list clusterclass based clusters created on TKGS. It would check if the clusterclass feature is enabled on TKGS, if so, would list all the clusters(same as TKGm) which includes both TKC and classy clusters. If the clusterclass feature is not enabled it would list all the TKC clusters.

Which issue(s) this PR fixes

Fixes #2887

Describe testing done for PR

Created both the TKC and ClusterClass based clusters and listed both the clusters successfully

❯ k get tkc -n testns
NAME          CONTROL PLANE   WORKER   TKR NAME                              AGE    READY   TKR COMPATIBLE   UPDATES AVAILABLE
prem-tkc-01   1               1        v1.22.8---vmware.1-tkg.2-zshippable   121m   True    True             [v1.23.5+vmware.1]

❯ ~/go/bin/tanzu cluster list
  NAME         NAMESPACE  STATUS   CONTROLPLANE  WORKERS  KUBERNETES        ROLES   PLAN  TKR
  prem-cc01    testns     running  1/1           1/1      v1.22.8+vmware.1  <none>        v1.22.8---vmware.1-tkg.2-zshippable
  prem-tkc-01  testns     running  1/1           1/1      v1.22.8+vmware.1  <none>        v1.22.8---vmware.1-tkg.2-zshippable

Release note

Add support to list clusterclass based clusters on TKGs

PR Checklist

  • Squash the commits into one or a small number of logical commits
  • Use good commit messages
  • Ensure PR contains terms all contributors can understand and links all contributors can access

Additional information

Special notes for your reviewer

Signed-off-by: Prem Kumar Kalle <pkalle@vmware.com>
@prkalle prkalle requested review from vuil and anujc25 July 8, 2022 23:15
@prkalle prkalle requested review from a team as code owners July 8, 2022 23:15
@prkalle prkalle added area/cli kind/bug PR/Issue related to a bug labels Jul 8, 2022
@github-actions
Copy link

github-actions bot commented Jul 8, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2886/20220708232418/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 Jul 8, 2022

Codecov Report

Merging #2886 (6b1137a) into main (e1d1386) will increase coverage by 0.00%.
The diff coverage is 92.85%.

@@           Coverage Diff            @@
##             main    #2886    +/-   ##
========================================
  Coverage   43.80%   43.81%            
========================================
  Files         414      414            
  Lines       41208    41308   +100     
========================================
+ Hits        18053    18098    +45     
- Misses      21466    21514    +48     
- Partials     1689     1696     +7     
Impacted Files Coverage Δ
pkg/v1/tkg/client/get_cluster.go 54.16% <0.00%> (ø)
pkg/v1/tkg/tkgctl/get_cluster.go 86.66% <100.00%> (+7.71%) ⬆️
addons/pkg/util/gvr_helper.go 59.57% <0.00%> (-8.52%) ⬇️
pkg/v2/tkr/util/topology/cluster.go 63.63% <0.00%> (-7.80%) ⬇️
pkg/v1/tkg/tkgpackageclient/package_update.go 83.57% <0.00%> (-1.43%) ⬇️
addons/controllers/clusterbootstrap_controller.go 63.28% <0.00%> (-1.40%) ⬇️
pkg/v1/tkg/tkgctl/create_cluster.go 60.82% <0.00%> (-0.96%) ⬇️
pkg/v1/tkg/tkgctl/client.go 52.20% <0.00%> (-0.67%) ⬇️
addons/webhooks/clusterbootstrap_webhook.go 24.32% <0.00%> (-0.30%) ⬇️
pkg/v1/tkg/client/upgrade_cluster.go 40.07% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1d1386...6b1137a. Read the comment docs.

Copy link
Contributor

@imikushin imikushin left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @prkalle!

@imikushin imikushin added the ok-to-merge PRs should be labelled with this before merging label Jul 11, 2022
@prkalle prkalle merged commit f0a894c into vmware-tanzu:main Jul 11, 2022
pgandigesang pushed a commit to pgandigesang/tanzu-framework that referenced this pull request Jul 15, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
area/cli cla-not-required kind/bug PR/Issue related to a bug ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tanzu cluster list only shows TKC clusters, doesn't show Classy-clusters
5 participants