Skip to content

build: fix test-integration - #175

Open
n-losse wants to merge 1 commit into
crossplane:mainfrom
n-losse:fix-test-integration
Open

build: fix test-integration#175
n-losse wants to merge 1 commit into
crossplane:mainfrom
n-losse:fix-test-integration

Conversation

@n-losse

@n-losse n-losse commented Sep 2, 2026

Copy link
Copy Markdown

Summary

Fixes make test-integration which was broken for several reasons accumulated since the script was last tested against the current build system and Crossplane v2.

Fixes

Build system mismatches

  • HELM3 is not exported by the build system (it exports HELM); renamed throughout the script and in the Makefile prerequisite — without this, the helm binary was never downloaded and the variable was always empty
  • KIND_NODE_IMAGE_TAG ?= v1.29.0 added to the Makefile so the value is defined before being passed to the script via KIND_NODE_IMAGE_TAG=${KIND_NODE_IMAGE_TAG}; previously it would expand to empty, causing kind to use kindest/node: with no version
  • CONTROLLER_IMAGE incorrectly included a -controller- infix that no image in this repo is built with; corrected to match the actual image name produced by make build
  • PACKAGE_CONTROLLER_IMAGE used ${DOCKER_REGISTRY}/ unconditionally, producing an invalid leading-slash reference when DOCKER_REGISTRY is empty; replaced with ${DOCKER_REGISTRY:+${DOCKER_REGISTRY}/}. The variable is now unused — the controller image is loaded into kind directly under its build name — but kept for potential external use
  • helm repo add now passes --force-update so repeated runs don't fail if the repo is already registered

Crossplane v2 package cache

  • The old code used up xpkg xp-extract --from-daemon on the controller runtime image, which is not a crossplane package — this produced an empty (EOF) cache file. Changed to crossplane xpkg extract --from-xpkg against the .xpkg file produced by make build.
  • Crossplane v2 added a CEL validation rule requiring spec.package to be a fully qualified OCI reference (registry.example.com/repo/name:tag or @digest). The previous value "provider-template" is rejected. The fix uses the non-routable hostname xpkg.crossplane.internal with a zeroed digest (sha256:0000...), which passes validation and causes Crossplane to skip the registry HEAD request and go straight to the local cache.
  • The cache filename is now computed to match crossplane-runtime's FriendlyID(source, digest) formula — truncate(source, 50) + "-" + truncate(digest, 12), DNS-label sanitized — so Crossplane can locate the extracted package.

Controller image for the provider pod

  • xpkg extract produces only the package metadata (CRDs, crossplane.yaml); it does not preserve the embedded runtime image. Crossplane therefore falls back to using the package OCI reference as the pod image, which does not exist in the kind cluster. A DeploymentRuntimeConfig is now created alongside the Provider to override the pod image to the locally loaded controller image, following the same pattern used by build/makelib/local.xpkg.mk.

Signed-off-by: Nikolas Losse <nikolas.losse@sap.com>
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.

1 participant