refactor: updating CAPX version to 1.9.x#10770
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @abhay-nutanix. Thanks for your PR. I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (75.48%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10770 +/- ##
==========================================
- Coverage 72.30% 72.25% -0.06%
==========================================
Files 608 608
Lines 39388 39443 +55
==========================================
+ Hits 28481 28499 +18
- Misses 9173 9203 +30
- Partials 1734 1741 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/hold will need to upgrade prism version first before updating CAPX to 1.9.x |
Summary
This PR upgrades the Cluster API Provider Nutanix (CAPX) dependency from v1.3.2 to v1.9.2 and migrates the Nutanix provider integration from the legacy Prism v3 API to the v4 converged API. This is a significant refactor that modernizes EKS Anywhere's Nutanix provider layer to align with the latest upstream CAPX types and Nutanix API clients.
Motivation
prism-go-client/v3API has been superseded by the converged v4 client and native Nutanix Go SDK modules (ntnx-api-golang-clients).Changes
Dependency Updates
cluster-api-provider-nutanixprism-go-clientsigs.k8s.io/cluster-apisigs.k8s.io/controller-runtimek8s.io/*modulesaws-sdk-go-v2smithy-goNew direct dependencies added:
github.com/nutanix/ntnx-api-golang-clients/clustermgmt-go-client/v4github.com/nutanix/ntnx-api-golang-clients/iam-go-client/v4github.com/nutanix/ntnx-api-golang-clients/networking-go-client/v4github.com/nutanix/ntnx-api-golang-clients/prism-go-client/v4github.com/nutanix/ntnx-api-golang-clients/vmm-go-client/v4API Migration (v3 → v4 Converged)
Clientinterface (pkg/providers/nutanix/client.go): Replaced v3 method signatures with v4 converged API equivalents. Methods now use native Nutanix v4 SDK models (subnetModels.Subnet,imageModels.Image,clusterModels.Cluster,prismModels.Category, etc.) and acceptconverged.ODataOptionfor server-side filtering.ListAllProjectremains on v3 as no v4 equivalent exists yet.ClientCache(pkg/providers/nutanix/clientcache.go): Updated to constructv4converged.Clientinstead ofv3.Client. The cache now wraps the converged client and delegates to its typed sub-clients (Subnets, Images, Clusters, Hosts, Categories, GPUs).PrismClient(internal/pkg/nutanix/prismclient.go): Migrated fromv3.NewV3Clienttov4converged.NewClient. All lookup methods (GetImageUUIDFromName,GetClusterUUIDFromName,GetSubnetUUIDFromName) now use server-side OData filtering instead of client-side list-and-filter.Validator Refactoring
hasPEClusterServiceEnabled()check that matches on theCLUSTERFUNCTIONREF_AOScluster function — matching the approach used by upstream CAPX.GetCurrentLoggedInUser(removed in v4) with aListClusters(ctx, WithLimit(1))call as a lightweight connectivity/auth check.GetCategoryKey+GetCategoryValuetwo-step lookups with a singleListCategoriescall using a combined OData filter (key eq '...' and value eq '...').availableGPUabstraction to bridge physical and virtual GPU profiles from the v4 API. GPU availability is now queried per-cluster viaListClusterPhysicalGPUsandListClusterVirtualGPUsinstead of iterating host responses.findProjectUUIDByName) usingListAllProject(v3) since there is no v4 equivalent yet.strings.EqualFoldfor case-insensitive comparison.CAPX Vendored Types (
internal/thirdparty/capx/)NutanixCluster,NutanixMachine,NutanixMachineTemplate, conditionsNutanixClusterTemplate— cluster infrastructure template supportNutanixFailureDomain— failure domain CRD for topology-aware deploymentsnutanix_types.go— shared Nutanix-specific type definitionszz_generated.deepcopy.goTest Updates
pkg/providers/nutanix/mocks/client.go) to reflect the newClientinterfaceprovider_test.goandvalidator_test.goto use v4 model types and match the updated validation logicRisk Assessment
Clientinterface is preserved as a seam, so all downstream consumers are insulated from the API version change. Tests have been updated to validate the new behavior.Breaking Changes
Clientinterface has changed, which affects internal consumers and mock generation only.