Skip to content

Compose a namespaced Request for a namespaced composite - #16

Merged
mbakalarski merged 1 commit into
mainfrom
namespaced-requests
Jul 28, 2026
Merged

Compose a namespaced Request for a namespaced composite#16
mbakalarski merged 1 commit into
mainfrom
namespaced-requests

Conversation

@mbakalarski

Copy link
Copy Markdown
Member

The composed Request's API group was hard-coded to http.crossplane.io/v1alpha2,
which is cluster scoped. Crossplane refuses to apply a cluster scoped composed
resource for a namespaced composite, and fails the whole reconcile:

cannot compose resources: cannot apply cluster scoped composed resource
"eapi-probe-c1443be641" (a Request named ) for a namespaced composite resource

So this function cannot be used at all by a consumer whose XRD is
scope: Namespaced. netclab-xp is moving its entire surface to Namespaced and
hit exactly this — its EosCommand layer is blocked until this ships.

The change

Pick the group from the composite's own namespace, which the function already
reads a line above:

  • namespaced composite → http.m.crossplane.io/v1alpha2
  • cluster scoped composite → http.crossplane.io/v1alpha2, unchanged

Nothing else moves. Crossplane places a composed namespaced resource in the
composite's namespace by itself, and provider-http defaults providerConfigRef
to the ProviderConfig named default in that namespace — both confirmed on a
live cluster, so neither has to be spelled out here.

Verification

crossplane render against the running function, both ways, using the existing
example/ manifests:

XR composed Request
example/xr1.yaml (no namespace) http.crossplane.io/v1alpha2
same XR + namespace: lab http.m.crossplane.io/v1alpha2

Unit tests: the existing one already covers the cluster scoped case, because its
fixture composite carries no namespace — it is the backward-compatibility guard.
The new one covers the namespaced case and asserts every composed resource, not
just the first.

Notes for the release

  • function/__version__.py is bumped to 0.0.22, since ci-with-bnp.yaml
    fails the release when the tag and that file disagree.
  • A namespaced Request requires provider-http >=v1.0.14, the first release
    serving http.m.crossplane.io. Consumers staying cluster scoped are
    unaffected.

🤖 Generated with Claude Code

The Request's API group was hard-coded to http.crossplane.io/v1alpha2, which
is cluster scoped. Crossplane refuses to apply a cluster scoped composed
resource for a namespaced composite, failing the entire reconcile:

  cannot compose resources: cannot apply cluster scoped composed resource
  "..." (a Request named ) for a namespaced composite resource

So any consumer whose XRD is scope: Namespaced cannot use this function at
all. netclab-xp is moving its whole surface to Namespaced and hit exactly
this.

Pick the group from the composite's own namespace, which the function already
reads: namespaced composites get http.m.crossplane.io/v1alpha2, cluster scoped
ones keep http.crossplane.io/v1alpha2 unchanged. Nothing else moves --
Crossplane places a composed namespaced resource in the composite's namespace
by itself, and provider-http defaults providerConfigRef to the ProviderConfig
named "default" there, so neither needs spelling out.

Verified with crossplane render against the running function, both ways: the
existing cluster scoped example still renders http.crossplane.io, the same XR
with a namespace renders http.m.crossplane.io. The existing unit test covers
the cluster scoped case (its fixture has no namespace); the new one covers the
namespaced case.

Note that the namespaced Request needs provider-http >=v1.0.14, which is the
first release serving http.m.crossplane.io.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mbakalarski
mbakalarski merged commit f8e51ff into main Jul 28, 2026
2 checks passed
@mbakalarski
mbakalarski deleted the namespaced-requests branch July 28, 2026 16:26
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