Skip to content

Bump crossplane go module to v2, bump crossplane-runtime imports to v2#6667

Merged
jbw976 merged 4 commits intocrossplane:mainfrom
jbw976:mod-v2
Jul 31, 2025
Merged

Bump crossplane go module to v2, bump crossplane-runtime imports to v2#6667
jbw976 merged 4 commits intocrossplane:mainfrom
jbw976:mod-v2

Conversation

@jbw976
Copy link
Copy Markdown
Member

@jbw976 jbw976 commented Jul 30, 2025

Description of your changes

This PR bumps the module name to github.com/crossplane/crossplane/v2 in preparation for the v2.0 release, as well as picks up the latest crossplane-runtime and updates all its import paths to github.com/crossplane/crossplane-runtime/v2.

Part of #6656

I've tested this with a full build and earthly +hack --SIMULATE_CROSSPLANE_VERSION=v2.0.0, then installing existing providers and functions via the demo scenarios in https://github.com/jbw976/demo-xp-layers and ensuring they still completely work. Everything looked fine 🙌

NOTE: after this is merged, when folks bump their imports of this repo, they will also need to update all of their import statements, similar to what is seen in this PR.

I have:

Need help with this checklist? See the cheat sheet.

@jbw976 jbw976 requested review from a team, negz, phisco and turkenh as code owners July 30, 2025 05:03
@jbw976 jbw976 requested a review from bobh66 July 30, 2025 05:03
@jbw976 jbw976 changed the title Mod v2 Bump crossplane go module to v2 Jul 30, 2025
ARG GOARCH=${TARGETARCH}
ARG GOOS=${TARGETOS}
ARG GOFLAGS="\"-ldflags=-s -w -X=github.com/crossplane/crossplane/internal/version.version=${CROSSPLANE_VERSION}\""
ARG GOFLAGS="\"-ldflags=-s -w -X=github.com/crossplane/crossplane/v2/internal/version.version=${CROSSPLANE_VERSION}\""
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

almost missed this one! only noticed it when earthly +hack --SIMULATE_CROSSPLANE_VERSION=v2.0.0 wasn't bringing up a crossplane that actually had a version 😇

Copy link
Copy Markdown
Member

@turkenh turkenh left a comment

Choose a reason for hiding this comment

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

Looking good, thanks @jbw976 🙌

// ConvertSecretReference 'converts' a SecretReference by producing a deepcopy.
// This is necessary because goverter panics on type aliases (SecretReference is
// a type alias for common.SecretReference).
func ConvertSecretReference(in *xpv1.SecretReference) *xpv1.SecretReference {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This function was added because of the new type alias for SecretReference that was added in crossplane/crossplane-runtime@c056ae9#diff-0d8ebf4c1879297c0b02781d58ee25833e3e21e993939eda922e3ef49a7e417cR64.

Another way to handle this could be to change our usage of v1.SecretReference to common.SecretReference, but this converter approach could be more scoped. What do you think @turkenh?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

nevermind, @n3wscott figured out that bumping goverter to v1.9.1 fixes this panic and removes the need for the custom converter. it's gone now! 👋

@jbw976
Copy link
Copy Markdown
Member Author

jbw976 commented Jul 30, 2025

@turkenh I have added more commits to bump crossplane-runtime to crossplane-runtime/v2 also in this PR, so it's all done in one shot. Most of that is mechanical and doesn't give me concern, but I would like your opinion on #6667 (review) 🤔

@jbw976 jbw976 changed the title Bump crossplane go module to v2 Bump crossplane go module to v2, bump crossplane-runtime imports to v2 Jul 30, 2025
@jbw976 jbw976 force-pushed the mod-v2 branch 2 times, most recently from 8e199e3 to 562fe5b Compare July 30, 2025 22:33
jbw976 added 4 commits July 30, 2025 15:36
Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
…rossplane/crossplane-runtime/v2

Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
@jbw976
Copy link
Copy Markdown
Member Author

jbw976 commented Jul 31, 2025

Hooray, fuzz testing is fixed now from crossplane/crossplane-runtime#860 and 2a180eb 🎉

Both e2e test failures are TestExternallyManagedServiceAccount, which I've captured as a flaky test in:

If @turkenh is good with the crossplane-runtime/v2 bump stuff too, then we are ready for merge!

@jbw976 jbw976 merged commit 8c58862 into crossplane:main Jul 31, 2025
41 of 43 checks passed
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.

[v2] bump go.mod to v2 for both core and runtime

2 participants