Skip to content

Conversation

alcampag
Copy link
Member

What this PR does / why we need it:
This PR introduces a new field for OCIManagedCluster that allows for the network to be created in a different compartment than the one specified in OCIManagedCluster.Spec.CompartmentId

The new field is called OCIManagedCluster.Spec.NetworkSpec.CompartmentId, it is optional and if not set it will default to the only compartment specified.

In addition, this PR fixes many bugs on the managed machine pool controller. The controller logic caused continues updates on the node pool if the original OCIManagedCluster was modified. This is because not all fields were set as the actual managed node pool state and updated correctly.

The new reconciliation logic is following this design:

  • If the user has defined a value for a field in the OCIManagedCluster object, then the controller will try to synchronize it
  • If the field is not specified entirely, the controller will try to keep it as defined in the actual state of the node pool

Which issue(s) this PR fixes:
Fixes #450

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 26, 2025
@joekr joekr added bug Something isn't working enhancement New feature or request labels Sep 26, 2025
@joekr
Copy link
Member

joekr commented Sep 29, 2025

What happens if a user 1) updates the network compartment ID to a new compartment or 2) deletes the network compartment id?

@joekr
Copy link
Member

joekr commented Sep 29, 2025

Instead of calling out all the places tests need to be added I'll just make the blanket statement here. We need to make sure we have some unit test coverage for this update. I know we talked about adding e2e tests around this already as well, but I'm just putting this in the comment for posterity.

@alcampag
Copy link
Member Author

I will need to think how to handle the networkCompartmentId update/deletion.

@joekr
Copy link
Member

joekr commented Sep 30, 2025

I will need to think how to handle the networkCompartmentId update/deletion.

We talked about this and we came to the conclusion that update/delete of the compartmentID won't work as it is setup now. We won't address this as part of this PR. At somepoint in the future we will induce this but it will need to leverage https://docs.oracle.com/en-us/iaas/api/#/en/iaas/latest/Vcn/ChangeVcnCompartment. This will be a bigger lift than just adding it as part of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibility to provision OCI Managed Control Plane and network on different compartments
2 participants