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

Add core.tanzu.vmware.com/v1alpha2 Capability resource #3836

Merged

Conversation

rajathagasthya
Copy link
Member

What this PR does / why we need it

API group needs bumping because of the new incoming FeatureGate API changes, which means Capability resource should be at v1alpha2 as well.

This commit does the following:

  • Adds new v1alpha2 Capability types which are identical to v1alpha1 types.
  • Updates CRD manifest with the new version. The v1alpha1 version is no longer served and v1alpha2 is set as the storage version. Since the types are identical and we don't serve v1alpha1 anymore, we don't need a conversion webhook. The controller just reads all existing v1alpha1 resources and writes it back in the new storage version v1alpha2.
  • Changes capability controller to work on v1alpha2 types.
  • Updates docs.

Which issue(s) this PR fixes

Fixes #3835

Describe testing done for PR

  1. Install old v1alpha1 Capability CRD.
  2. Run the capabilities controller and create a v1alpha1 CR:
apiVersion: core.tanzu.vmware.com/v1alpha1
kind: Capability
metadata:
  name: tkg-capabilities
  namespace: tkg-system
spec:
  serviceAccountName: "tanzu-capabilities-manager-default-sa"
  queries:
    - name: "tanzu-cluster-with-capability"
      groupVersionResources:
        - name: "capability-resource"
          group: "core.tanzu.vmware.com"
          versions:
            - v1alpha1
          resource: "capabilities"
  1. Update the Capability API to v1alpha2 (v1alpha1 is no longer stored) and re-run the controller.
  2. Controller should re-write all existing CRs to v1alpha2.
apiVersion: core.tanzu.vmware.com/v1alpha2
kind: Capability
metadata:
  name: tkg-capabilities
  namespace: tkg-system
spec:
  serviceAccountName: "tanzu-capabilities-manager-default-sa"
  queries:
    - name: "tanzu-cluster-with-capability"
      groupVersionResources:
        - name: "capability-resource"
          group: "core.tanzu.vmware.com"
          versions:
            - v1alpha1
          resource: "capabilities"

Release note

`capabilities.core.tanzu.vmware.com` has been updated to v1alpha2 and is identical to v1alpha1. The v1alpha1 Capability API is no longer served. Clients must immediately update to using the v1alpha2 API.

Additional information

Special notes for your reviewer

@rajathagasthya rajathagasthya requested review from a team as code owners November 3, 2022 11:58
@rajathagasthya rajathagasthya added the ok-to-merge PRs should be labelled with this before merging label Nov 3, 2022
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #3836 (39f022b) into main (36b8972) will decrease coverage by 0.88%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #3836      +/-   ##
==========================================
- Coverage   46.57%   45.68%   -0.89%     
==========================================
  Files         401      426      +25     
  Lines       40130    41688    +1558     
==========================================
+ Hits        18692    19047     +355     
- Misses      19724    20909    +1185     
- Partials     1714     1732      +18     
Impacted Files Coverage Δ
...ons/controllers/packageinstallstatus_controller.go 77.99% <0.00%> (-1.16%) ⬇️
...in/cluster/get_machinehealthcheck_control_plane.go 11.11% <0.00%> (ø)
cmd/cli/plugin/cluster/available_upgrade.go 16.32% <0.00%> (ø)
cmd/cli/plugin/cluster/set_node_pool.go 14.63% <0.00%> (ø)
cmd/cli/plugin/cluster/osimage.go 100.00% <0.00%> (ø)
.../cli/plugin/cluster/get_machinehealthcheck_node.go 9.30% <0.00%> (ø)
cmd/cli/plugin/cluster/osimage_oracle.go 3.22% <0.00%> (ø)
cmd/cli/plugin/cluster/get.go 6.27% <0.00%> (ø)
cmd/cli/plugin/cluster/list.go 11.36% <0.00%> (ø)
cmd/cli/plugin/cluster/main.go 0.00% <0.00%> (ø)
... and 16 more

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

Copy link
Contributor

@codegold79 codegold79 left a comment

Choose a reason for hiding this comment

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

Pretty straightforward. LGTM.

@@ -326,6 +326,321 @@ spec:
- results
type: object
type: object
served: false
storage: false
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Just wanna double check that we only want v1alpha2 to be served and stored, correct ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct.

Copy link
Contributor

@danniel1205 danniel1205 left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@yharish991 yharish991 left a comment

Choose a reason for hiding this comment

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

lgtm!

API group needs bumping because of the new incoming FeatureGate API
changes, which means Capability resource should be at v1alpha2 as well.

This commit does the following:

* Adds new v1alpha2 Capability types which are identical to v1alpha1
  types.
* Updates CRD manifest with the new version. The v1alpha1 version is no
  longer served and v1alpha2 is set as the storage version. Since the
  types are identical and we don't serve v1alpha1 anymore, we don't need
  a conversion webhook. The controller just reads all existing v1alpha1
  resources and writes it back in the new storage version v1alpha2.
* Changes capability controller to work on v1alpha2 types.
* Updates docs.
@rajathagasthya rajathagasthya merged commit 602d409 into vmware-tanzu:main Nov 9, 2022
@rajathagasthya rajathagasthya deleted the capabilities-v1alpha2 branch November 9, 2022 02:04
hongtaiwang pushed a commit that referenced this pull request Nov 11, 2022
API group needs bumping because of the new incoming FeatureGate API
changes, which means Capability resource should be at v1alpha2 as well.

This commit does the following:

* Adds new v1alpha2 Capability types which are identical to v1alpha1
  types.
* Updates CRD manifest with the new version. The v1alpha1 version is no
  longer served and v1alpha2 is set as the storage version. Since the
  types are identical and we don't serve v1alpha1 anymore, we don't need
  a conversion webhook. The controller just reads all existing v1alpha1
  resources and writes it back in the new storage version v1alpha2.
* Changes capability controller to work on v1alpha2 types.
* Updates docs.
xiujuanx pushed a commit that referenced this pull request Nov 14, 2022
API group needs bumping because of the new incoming FeatureGate API
changes, which means Capability resource should be at v1alpha2 as well.

This commit does the following:

* Adds new v1alpha2 Capability types which are identical to v1alpha1
  types.
* Updates CRD manifest with the new version. The v1alpha1 version is no
  longer served and v1alpha2 is set as the storage version. Since the
  types are identical and we don't serve v1alpha1 anymore, we don't need
  a conversion webhook. The controller just reads all existing v1alpha1
  resources and writes it back in the new storage version v1alpha2.
* Changes capability controller to work on v1alpha2 types.
* Updates docs.
# 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.

Bump core.tanzu.vmware.com Capability resource to v1alpha2
5 participants