Skip to content

Use crossplane-runtime v2.0.0#356

Merged
nolancon merged 11 commits intomainfrom
crossplane-v2
Aug 20, 2025
Merged

Use crossplane-runtime v2.0.0#356
nolancon merged 11 commits intomainfrom
crossplane-v2

Conversation

@nolancon
Copy link
Collaborator

@nolancon nolancon commented Aug 19, 2025

Description of your changes

Crossplane V2 has been released. This also means a new release (v2.0.0) of crossplane-runtime which includes crossplane/crossplane-runtime#841. This PR makes all the necessary changes to upgrade to crossplane-runtime V2 and updates the code to make use of the linked patch as this was a known issue with Provider Ceph and many other Crossplane Providers. This PR does not upgrade Provider Ceph to use Crossplane v2. For now, Crossplane v1.20 is kept in place (crossplane-runtime v2 is compatible). The main reason for this is that there are issues with Provider Ceph's current Chainsaw test workflow and Crossplane v2 - it seems we are no longer able to specify a Crossplane package as a ".gz" file which breaks the current load-package make target. This needs to be investigated further and will require a separate PR. For now, we are only implementing crossplane-runtime v2 in order to make use of the linked patch.

I have:

  • Run make reviewable to ensure this PR is ready for review.
  • Run make ceph-chainsaw to validate these changes against Ceph. This step is not always necessary. However, for changes related to S3 calls it is sensible to validate against an actual Ceph cluster. Localstack is used in our CI Chainsaw suite for convenience and there can be disparity in S3 behaviours betwee it and Ceph. See docs/TESTING.md for information on how to run tests against a Ceph cluster.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

All existing CI is passing locally and on GHA

@nolancon nolancon marked this pull request as ready for review August 19, 2025 10:30
# as including the k8s_tools machinery prior to the xpkg machinery sets UP to
# point to tool cache.
build.init: $(UP)
build.init: $(CROSSPLANE_CLI)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Is the comment still useful? I don't know the relationship between $(UP) and $(CROSSPLANE_CLI).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, will remove the comment - basically the up CLI has been replaced by the crossplane CLI

// Of course, this approach does not completely remove the possibility of us finding ourselves in
// the above scenario. It only mitigates it. As long as Crossplane persists with its existing logic
// then we can only make a "best-effort" to avoid it.
if err := c.updateBucketCR(ctx, bucket, func(bucketLatest *v1alpha1.Bucket) UpdateRequired {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Does deleting them mean the issue was fully solved in v2 (and v1.2.0)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this PR fixed the issue upstream so we no longer need to attempt to mitigate it here 🥳 crossplane-runtime v2.0.0 is the first version to include this patch.

managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))),
managed.WithConnectionPublishers(cps...),
managed.WithCreationGracePeriod(c.creationGracePeriod),
managed.WithDeterministicExternalName(true),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Q: Why are this change and removing ConnectionPublisher necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Similar to above, this PR allows a controller to designate a managed resource as having a deterministic name - this means crossplane will essentially "opt-out" of the previosuly problematic "pending annotation" behaviour (more details in the PR).

As for the ConnectionPublisher stuff - that has been removed upstream

Copy link
Collaborator

@Shunpoco Shunpoco left a comment

Choose a reason for hiding this comment

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

Nice PR!

@nolancon nolancon merged commit 12b6de1 into main Aug 20, 2025
10 checks passed
@nolancon nolancon deleted the crossplane-v2 branch August 20, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants