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

Update the KR plugin to implement the new TKR API v1alpha3 #2242

Merged
merged 1 commit into from
May 2, 2022

Conversation

prkalle
Copy link
Contributor

@prkalle prkalle commented Apr 26, 2022

  • Added a feature flag "features.global.tkr-version-v1alpha3-beta" (with default set to disabled) to enable KR plugin for new TKR API v1alpha3.
  • "available-upgrades" subcommand would not be available for TKR API version v1alpha3 as UpdatesAvailable condition will be removed in v1alpha3
  • Deprecated the below methods from tkgctl interface,user can use go-client to perform these operations
    i)GetTanzuKubernetesReleases
    ii)ActivateTanzuKubernetesReleases
    iii)DeactivateTanzuKubernetesReleases

Signed-off-by: PremKumar Kalle pkalle@vmware.com

What this PR does / why we need it

Update the kubernetes release plugin to implement the new TKR API v1alpha3

Which issue(s) this PR fixes

Fixes #1924

Describe testing done for PR

set the feature flag using tanzu config set features.global.tkr-version-v1alpha3-beta true
Later performed

  1. tanzu kr get and it successfully displayed the v1alpha3 TKRs
❯ tanzu kr get -a
  NAME                               VERSION                 COMPATIBLE  ACTIVE  
  v1.22.5---vmware.1-tkg.2  v1.22.5+vmware.1-tkg.2              True    
  v1.23.3---vmware.1-tkg.1  v1.23.3+vmware.1-tkg.1              True    
  v1.23.5---vmware.1-tkg.1  v1.23.5+vmware.1-tkg.1              True    

  1. tanzu kr deactivate -- it shows the TKR as deactivated by using tanzu kr get command
❯ tanzu kr get -a
  NAME                      VERSION                 COMPATIBLE  ACTIVE  
  v1.22.5---vmware.1-tkg.2  v1.22.5+vmware.1-tkg.2              True    
  v1.23.3---vmware.1-tkg.1  v1.23.3+vmware.1-tkg.1              True    
  v1.23.5---vmware.1-tkg.1  v1.23.5+vmware.1-tkg.1              True    
❯ tanzu kr deactivate v1.22.5---vmware.1-tkg.2
Applying patch to resource v1.22.5---vmware.1-tkg.2 of type *v1alpha3.TanzuKubernetesRelease ...
❯ tanzu kr get -a
  NAME                      VERSION                 COMPATIBLE  ACTIVE  
  v1.23.3---vmware.1-tkg.1  v1.23.3+vmware.1-tkg.1              True    
  v1.23.5---vmware.1-tkg.1  v1.23.5+vmware.1-tkg.1              True    

  1. tanzu kr activate -- it shows the TKR as activated by using tanzu kr get command
❯ tanzu kr activate v1.22.5---vmware.1-tkg.2
Applying patch to resource v1.22.5---vmware.1-tkg.2 of type *v1alpha3.TanzuKubernetesRelease ...
❯ tanzu kr get -a
  NAME                      VERSION                 COMPATIBLE  ACTIVE  
  v1.22.5---vmware.1-tkg.2  v1.22.5+vmware.1-tkg.2              True    
  v1.23.3---vmware.1-tkg.1  v1.23.3+vmware.1-tkg.1              True    
  v1.23.5---vmware.1-tkg.1  v1.23.5+vmware.1-tkg.1              True    


  1. tanzu kr os -- it shows the os information for all the supported os images
❯ tanzu kr os get v1.22.5---vmware.1-tkg.2 --region us-west-2
  NAME    VERSION  ARCH   
  ubuntu  20.04    amd64  
  amazon  2        amd64  
❯ tanzu kr os get v1.22.5---vmware.1-tkg.2 --region us-west-1
  NAME  VERSION  ARCH  

Release note

Update the KR plugin to implement the new TKR API v1alpha3

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

@prkalle prkalle requested a review from imikushin April 26, 2022 22:22
@prkalle prkalle requested a review from a team as a code owner April 26, 2022 22:22
@prkalle prkalle requested a review from a team as a code owner April 26, 2022 22:22
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2242/20220426223412/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.

@prkalle prkalle force-pushed the add/tkrPlugin_newAPI branch from d2a186a to 6840d51 Compare April 26, 2022 23:21
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2242/20220426233225/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.

@prkalle prkalle force-pushed the add/tkrPlugin_newAPI branch from 6840d51 to a727f9f Compare April 27, 2022 02:01
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2242/20220427021343/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.

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.

Thanks! LGTM.

I added a couple very minor comments: mostly stylistic.
Feel free to either fix or ignore.

cmd/cli/plugin/tkr/v1alpha1/activate_deactivate.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha1/activate_deactivate.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/activate_deactivate.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/activate_deactivate.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/os.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/os.go Outdated Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/os.go Show resolved Hide resolved
cmd/cli/plugin/tkr/v1alpha3/os.go Outdated Show resolved Hide resolved
@imikushin imikushin added the ok-to-merge PRs should be labelled with this before merging label Apr 29, 2022
@prkalle prkalle force-pushed the add/tkrPlugin_newAPI branch from a727f9f to 84654fa Compare May 2, 2022 14:37
@github-actions
Copy link

github-actions bot commented May 2, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2242/20220502144819/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.

-  Added a feature flag "features.global.tkr-version-v1alpha3-beta" (with default set to disabled) to enable KR plugin for new TKR API v1alpha3.
- "available-upgrades" subcommand would not be available for TKR API version v1alpha3 as UpdatesAvailable condition will be removed in v1alpha3
- Deprecated the below methods from tkgctl interface,user can use go-client to perform these operations
   i)GetTanzuKubernetesReleases
   ii)ActivateTanzuKubernetesReleases
   iii)DeactivateTanzuKubernetesReleases

Signed-off-by: PremKumar Kalle <pkalle@vmware.com>
@prkalle prkalle force-pushed the add/tkrPlugin_newAPI branch from 84654fa to 7facf4a Compare May 2, 2022 16:41
@github-actions
Copy link

github-actions bot commented May 2, 2022

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/2242/20220502165326/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.

@prkalle prkalle merged commit 4cebdb9 into vmware-tanzu:main May 2, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the kr plugin to use the new TKR API
3 participants