Skip to content

Adopt crossplane-runtime v2.3.x: migrate common APIs to crossplane/apis/v2/core/v2 #663

Description

@jschoombee

What problem are you facing?

upjet/v2 is pinned to crossplane-runtime/v2 v2.2.0, which blocks downstream providers from adopting crossplane-runtime/v2 v2.3.x.

crossplane-runtime v2.3.0 introduced a breaking change that affects upjet directly:

The common APIs from crossplane-runtime have moved to github.com/crossplane/crossplane/apis/v2/core.

Concretely, packages and symbols that no longer exist in crossplane-runtime/v2 ≥ v2.3.0:

  • github.com/crossplane/crossplane-runtime/v2/apis/common
  • github.com/crossplane/crossplane-runtime/v2/apis/common/v1
  • github.com/crossplane/crossplane-runtime/v2/apis/common/v2

…and the inline-embedded spec/status types have been renamed:

  • v1.ResourceSpecv2.ClusterManagedResourceSpec (cluster-scoped) / v2.ManagedResourceSpec (namespaced)
  • v1.ResourceStatusv2.ManagedResourceStatus

Today, any provider attempting to bump crossplane-runtime/v2 to v2.3.x via Renovate sees CI fail with missing go.sum entry errors because upjet still imports the removed packages transitively. The hand-written upjet sources reference the same packages and types.

How could upjet help solve your problem?

Bump crossplane-runtime/v2 to v2.3.1 in upjet and migrate:

  1. Imports in ~17 source files: swap the three old package paths for the consolidated github.com/crossplane/crossplane/apis/v2/core/v2 path.
  2. Codegen pipeline:
    • pkg/types/reference.go PackagePathXPCommonAPIs and PackagePathXPV2CommonAPIs → consolidated path.
    • pkg/pipeline/templates/crd_types.go.tmpl → emit ClusterManagedResourceSpec for cluster-scoped MRs (replacing ResourceSpec) and ManagedResourceStatus (replacing ResourceStatus).
  3. Embedded-type-string test fixtures in pkg/types/builder_test.go refreshed to match the new fully-qualified paths.
  4. tests/conversion/test_resource.go field embeds renamed to the new cluster-scoped types.
  5. go.mod: bump to crossplane-runtime/v2 v2.3.1 and add a direct require on crossplane/apis/v2 v2.3.1; go mod tidy.

I have a working implementation locally — all of go test ./... -count=1 is green. PR forthcoming.

Happy to backport to release-2.2 if maintainers want it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions