Follow-ups for Crossplane v1 compatibility - #1
Merged
jakubramut merged 3 commits intoJul 29, 2026
Conversation
Crossplane only defaults a Function to the composition capability when no capabilities are declared at all, so an empty list would silently break every composition using this function. Signed-off-by: Philippe Scorsolini <5697904+phisco@users.noreply.github.com>
The namespace is not honored server-side on Crossplane v1 and never matches a cluster-scoped kind on either major. The Reference not-found error also blamed the Crossplane version for what is usually a typo. Signed-off-by: Philippe Scorsolini <5697904+phisco@users.noreply.github.com>
Signed-off-by: Philippe Scorsolini <5697904+phisco@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Review follow-ups for crossplane-contrib#111, against its branch so they land together.
maindeclarescapabilities: [required-resources], and Crossplane only defaults a Function tocompositionwhen no capabilities are declared at all — so on v2 every XR referencing this function currently fails withMissingCapabilities. Dropping the block, as this PR's base does, is what fixes that. Declaringcompositionexplicitly makes it robust rather than incidental:capabilities: []would silently break composition again, and it's what the other crossplane-contrib functions do.The rest is about
namespace, which now behaves differently on each major and can surprise people either way. It selects nothing on cluster-scoped kinds —EnvironmentConfigamong them — because those have an empty namespace, and the Reference not-found error blamed the Crossplane version for what on v2 is usually just a typo.Tested with
go test ./...and golangci-lint at the CI-pinned v2.6.2. The input CRD carries only the matching description change: a fullgo generate ./...would also pull in a controller-gen v0.20.0 refresh that go.mod has been due since before this branch, which doesn't belong here.I have: