Skip to content

[WIP] Upgrade capi v1.11.0#486

Open
tamikaxuross wants to merge 22 commits into
oracle:mainfrom
tamikaxuross:upgrade-capi-v1.11.0
Open

[WIP] Upgrade capi v1.11.0#486
tamikaxuross wants to merge 22 commits into
oracle:mainfrom
tamikaxuross:upgrade-capi-v1.11.0

Conversation

@tamikaxuross

Copy link
Copy Markdown
Member

WIP - Do Not Merge

Upgrading CAPOCI to support Cluster API v1.11.0.

What this PR does / why we need it:
CAPI v1.11.0 introduces v1beta2 as the default storage version. Controllers now receive v1beta2 objects from the API server, so conversion code was added to maintain compatibility with existing v1beta1 scopes.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

- Updated go.mod: CAPI v1.10.6 → v1.11.0
- Updated import paths: api/v1beta1 → api/core/v1beta1
- Updated conditions imports to use deprecated v1beta1 package
- Updated Makefile conversion-gen peer directories
- 1 remaining compilation error in machine.go IsControlPlaneMachine
- Implemented IsControlPlaneMachine directly in machine.go
- Removed unused capiUtil import
- Fixes v1beta1/v1beta2 type mismatch for this function
…luster_controller conversion

- Update ClusterUnpausedAndInfrastructureReady to ClusterPausedTransitionsOrInfrastructureProvisioned
- Fix ContractVersionedObjectReference nil checks (use ref.Name == '' instead of ref == nil)
- Fix namespace access (use cluster.Namespace instead of ref.Namespace)
- Add v1beta2 to v1beta1 Cluster conversion in ocicluster_controller.go
- Change clusterv1 imports to v1beta1 in controllers

Remaining: Add conversion to other controllers (ocimachine, ocimanagedcluster, machinepool controllers)
…d clusterv1beta2 import - Convert cluster and machine from v1beta2 to v1beta1 - Update scope params to use converted types Remaining: ocimanagedcluster_controller, ocimanagedcluster_controlplane_controller, and exp/controllers (machinepool controllers)
…er - Add cluster conversion after IsPaused check - Update scope params and reconcile call to use clusterV1beta1 Remaining: ocimanagedcluster_controlplane_controller and 3 exp/controllers
…lane_controller

- Add cluster conversion after IsPaused check
- Update scope params to use clusterV1beta1
- Keep original cluster for annotations.IsPaused calls

Remaining: 3 exp/controllers (machinepool controllers)
- Add v1beta2 to v1beta1 Cluster conversion to all controllers
- Fix exp/controllers: ocimachinepool, ocimanaged_machinepool, ocivirtual_machinepool
- All controllers now properly convert v1beta2 Cluster from util.GetOwnerCluster()
  to v1beta1 for scope compatibility

make build now completes successfully with bin/manager created.
Summary of changes:
- Updated go.mod: CAPI v1.10.6 → v1.11.0
- Updated import paths: api/v1beta1 → api/core/v1beta1
- Migrated conditions to deprecated/v1beta1/conditions package
- Fixed predicates: ClusterUnpausedAndInfrastructureReady → ClusterPausedTransitionsOrInfrastructureProvisioned
- Fixed ContractVersionedObjectReference (not a pointer, no Namespace field)
- Added v1beta2→v1beta1 Cluster conversion in all controllers

Test failures are unrelated to the upgrade (linting + scheme registration).
Binary successfully created at bin/manager.
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jan 5, 2026
- Fix format string linting issues in validators and controllers
- Update fuzzer functions from fuzz.Continue to randfill.Continue
- Register clusterv1beta2 types in test schemes
- Update event reason ClusterNotAvailable to ClusterDoesNotExist
- Fix GetOPCRetryToken calls to use format strings
- Replace runtime.NewScheme() with scheme.Scheme in controller tests
- Add scheme import to controller test files
- Add clusterv1beta2 import and update test helper functions
- Change Cluster/Machine objects from v1beta1 to v1beta2 in tests
- Register clusterv1beta2 in test suite schemes
- Fix duplicate imports in test files
- Update ClusterSpec to use ContractVersionedObjectReference
- Update Paused field to use ptr.To(true) for *bool type
- Update MachineSpec references to v1beta2
- Add ptr import for pointer helpers
- Create cloud/util/conversion.go with ConvertClusterV1Beta2ToV1Beta1,
  ConvertMachineV1Beta2ToV1Beta1, and ConvertMachinePoolV1Beta2ToV1Beta1
- Update all controllers to use JSON-based conversion instead of
  scheme-dependent ConvertFrom method
- Fix controller test imports and type issues

Build passes, test infrastructure updates still needed.
added setupScheme to register v1beta2 types in fake clients
still working through remaining test files
- add setupScheme() to register v1beta2 types in fake clients
- update test helpers to use clusterv1beta2.Cluster and Machine for fake client objects
- keep v1beta1 versions for scope compatibility
- most controller tests now passing, remaining failures are delete scenario tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant