github crossplane/upjet v2.5.0

5 hours ago

This is a minor release that ships several new configuration and runtime capabilities for upjet-based providers, together with a set of bug fixes and security-relevant dependency updates.

⚠️ Common APIs moved to github.com/crossplane/crossplane/apis/v2/core/v2 (#664)

crossplane-runtime v2.3.0 consolidated the common API types out of
crossplane-runtime/v2/apis/common/{v1,v2} into a single package, and renamed two embedded types. The API shapes stay identical.

Before After
xpv1.ResourceSpec xpv2.ClusterManagedResourceSpec (cluster-scoped MRs)
xpv1.ResourceStatus xpv2.ManagedResourceStatus

Everything else (Reference, Selector, SecretReference, SecretKeySelector,
LocalSecretReference, LocalSecretKeySelector, NamespacedReference,
NamespacedSelector, Condition*, ManagementAction*, ManagementPolicies,
DeletionPolicy) keeps its name, only the import path changes.

To upgrade a provider:

  1. Bump github.com/crossplane/crossplane-runtime/v2 to v2.4.0 and add a
    direct require on github.com/crossplane/crossplane/apis/v2 v2.4.1, then
    go mod tidy. The build will not compile without the direct dependency.
  2. Run make generate. Upjet emits the new package path and type names for all
    zz_*.go files automatically.
  3. ⚠️ Hand-written code importing the old apis/common/{v1,v2} paths must be updated manually.

PackagePathXPCommonAPIs and PackagePathXPV2CommonAPIs in pkg/types now both
point at the consolidated package; they are kept as separate constants for source-level backward compatibility.

See the expanded Upjet v2 upgrade guide for the full walkthrough.

Features

  • config.Resource.OverrideScalarFieldType (#724) — lets provider authors
    override the generated Go type for a scalar field at a given Terraform path
    (e.g. "x.y", wildcard segments omitted). Overriding a non-scalar path returns
    a descriptive error. types.Builder.buildSchema now honors these overrides.
  • types.StringOrBool (#724) — a type stored canonically as a string that
    also decodes from JSON booleans, backed by the new generic
    internal.StringOrPrimitive[T] (supports ~bool and all int/uint kinds).
    Use it with OverrideScalarFieldType via types.NewStringOrBoolType() to
    accept both "true" and true in a CRD field without a breaking API change.

Bug fixes

  • Plugin Framework: don't suppress unset-value diffs (#640) —
    filteredDiffExists previously dropped every diff whose planned value was
    null, so clearing a previously set field produced no update. Such diffs are now
    kept unless the attribute (or one of its ancestors) is computed-only.
  • SDK v2: apply TF conversions before filtering initProvider diffs (#728) —
    filterInitExclusiveDiffs now runs ApplyTFConversions(..., ToTerraform) on
    both spec.forProvider and spec.initProvider before computing the
    init-exclusive key set. Without this, resources using TF conversions (e.g.
    singleton-list conversions) mis-identified which keys were initProvider-only.
  • tfjson: don't infer Computed for SchemaNestingModeSingle blocks (#593) — the MinItems == 0 && MaxItems == 0 → Computed heuristic is
    valid for SDK v2 collections but wrong for Plugin Framework single blocks,
    which always leave Min/MaxItems at 0. Such blocks were landing in
    Observation only, never in ForProvider/InitProvider. They are now always
    Optional and never Computed. MinItems > 0 blocks are correctly marked
    Required. Adds unit tests for tfJSONBlockTypeToV2Schema and
    hasRequiredChild.

Documentation

  • New Storage Version Migration guide (#719)
    — why removing a deprecated CRD version does not rewrite objects already in
    etcd, and how to handle it.
  • New Applying Storage Version Migration
    guide (#719) — step-by-step procedure, including cleanup.
  • Upjet v2 upgrade guide extended with the
    crossplane-runtime v2.3.x migration callout (#664).

Dependency & security updates

  • The module now declares go 1.26.8 (#745)
  • google.golang.org/grpc to v1.83.2 (#751)

Full PR list

  • bump crossplane-runtime and crossplane/apis to v2.3.3 by @jschoombee in #664
  • Bump github.com/upbound/uptest to commit c230a8044006 by @ulucinar in #716
  • Add guides for the storage version migration library by @sergenyalcin in #719
  • fix: apply TF conversions before filtering initProvider-exclusive diffs by @sergenyalcin in #728
  • Add config.Resource.OverrideScalarFieldType by @ulucinar in #724
  • Update dependency docker/buildx to v0.36.1 by @renovate[bot] in #720
  • Update go module directive to v1.26.7 by @renovate[bot] in #731
  • Update github/codeql-action action to v4.37.7 by @renovate[bot] in #721
  • Update negz/create-tag action to v2 by @renovate[bot] in #736
  • Check for previous null values in filtered diffs by @stevendborrelli in #640
  • Update module github.com/crossplane/crossplane/apis/v2 to v2.4.0 by @renovate[bot] in #744
  • Update module github.com/crossplane/crossplane-runtime/v2 to v2.4.0 by @renovate[bot] in #743
  • Update module google.golang.org/grpc to v1.83.1 [SECURITY] by @renovate[bot] in #747
  • Update go module directive to v1.26.8 by @renovate[bot] in #745
  • Update dependency docker/buildx to v0.37.0 by @renovate[bot] in #748
  • Update github/codeql-action action to v4.37.9 by @renovate[bot] in #740
  • Update dependency golangci/golangci-lint to v2.13.2 by @renovate[bot] in #607
  • fix(tfjson): Reset Computed flag for SchemaNestingModeSingle blocks with required children by @rwwiv in #593
  • Update module google.golang.org/grpc to v1.83.2 [SECURITY] by @renovate[bot] in #751
  • Update github/codeql-action action to v4.38.0 by @renovate[bot] in #750

New Contributors

Full Changelog: v2.4.0...v2.5.0

Don't miss a new upjet release

NewReleases is sending notifications on new releases.