Summary
crossplane render (and crossplane composition render) silently ignores all but the
last --extra-resources / --required-resources flag. When the flag is passed more
than once, only the file/dir given in the final occurrence is loaded; resources in the
earlier occurrences are never made available to the function pipeline — with no error or
warning. Functions that request those resources receive an empty set.
- CLI:
crossplane v2.3.1
- Render engine:
--crossplane-version=v2.3.1 (Docker-based render; default stable)
- function-go-templating v0.12.1, function-auto-ready v0.6.5
Files
xr.yaml — a trivial composite resource
xrd.yaml — the XRD defining the XR composite type. Optional — crossplane render does not require an XRD (it renders the XR directly against the Composition);
it's included only to make the example self-contained and can be passed with --xrd.
min-composition.yaml — one pipeline step (function-go-templating) that requests a
ConfigMap labelled group=a and writes the number it received into the composed
ConfigMap's data.count
min-wanted.yaml — the ConfigMap the function wants (group=a)
min-filler.yaml — an unrelated ConfigMap (group=b)
functions-public.yaml — same functions using public xpkg.crossplane.io images
functions-public.yaml
min-composition.yaml
min-filler.yaml
min-wanted.yaml
xr.yaml
xrd.yaml
Run
# Docker must be running (the engine renders in a container)
# A) single flag — works, count == 1
crossplane composition render --crossplane-version=v2.3.1 \
xr.yaml min-composition.yaml functions-public.yaml \
--extra-resources min-wanted.yaml | grep count
# B) two flags, wanted THEN filler — BUG: count == 0 (wanted file is dropped)
crossplane composition render --crossplane-version=v2.3.1 \
xr.yaml min-composition.yaml functions-public.yaml \
--extra-resources min-wanted.yaml \
--extra-resources min-filler.yaml | grep count
# C) two flags, filler THEN wanted — works, count == 1 (only the LAST flag is honored)
crossplane composition render --crossplane-version=v2.3.1 \
xr.yaml min-composition.yaml functions-public.yaml \
--extra-resources min-filler.yaml \
--extra-resources min-wanted.yaml | grep count
Observed
| Invocation |
data.count |
A) --extra-resources wanted |
"1" ✅ |
B) --extra-resources wanted --extra-resources filler |
"0" ❌ |
C) --extra-resources filler --extra-resources wanted |
"1" ✅ |
Putting both resources in a single file (or a single directory) also yields "1",
confirming the data is fine — only the repeated flag is mishandled.
The same is observable with --required-resources (the non-deprecated flag) and with a
mix of resource kinds (e.g. a step requesting a custom resource plus a
function-environment-configs step requesting an EnvironmentConfig): whichever
requirement's resource is not in the final --extra-resources file is dropped, and the
corresponding function silently composes nothing.
Expected
Resources from all --extra-resources / --required-resources occurrences should be
merged and made available to the pipeline.
Workaround
Pass a single --extra-resources argument — either one YAML file containing all the
resources, or a directory of YAML files.
Summary
crossplane render(andcrossplane composition render) silently ignores all but thelast
--extra-resources/--required-resourcesflag. When the flag is passed morethan once, only the file/dir given in the final occurrence is loaded; resources in the
earlier occurrences are never made available to the function pipeline — with no error or
warning. Functions that request those resources receive an empty set.
crossplanev2.3.1--crossplane-version=v2.3.1(Docker-based render; defaultstable)Files
xr.yaml— a trivial composite resourcexrd.yaml— the XRD defining theXRcomposite type. Optional —crossplane renderdoes not require an XRD (it renders the XR directly against the Composition);it's included only to make the example self-contained and can be passed with
--xrd.min-composition.yaml— one pipeline step (function-go-templating) that requests aConfigMap labelled
group=aand writes the number it received into the composedConfigMap's
data.countmin-wanted.yaml— the ConfigMap the function wants (group=a)min-filler.yaml— an unrelated ConfigMap (group=b)functions-public.yaml— same functions using publicxpkg.crossplane.ioimagesfunctions-public.yaml
min-composition.yaml
min-filler.yaml
min-wanted.yaml
xr.yaml
xrd.yaml
Run
Observed
data.count--extra-resources wanted"1"✅--extra-resources wanted --extra-resources filler"0"❌--extra-resources filler --extra-resources wanted"1"✅Putting both resources in a single file (or a single directory) also yields
"1",confirming the data is fine — only the repeated flag is mishandled.
The same is observable with
--required-resources(the non-deprecated flag) and with amix of resource kinds (e.g. a step requesting a custom resource plus a
function-environment-configsstep requesting anEnvironmentConfig): whicheverrequirement's resource is not in the final
--extra-resourcesfile is dropped, and thecorresponding function silently composes nothing.
Expected
Resources from all
--extra-resources/--required-resourcesoccurrences should bemerged and made available to the pipeline.
Workaround
Pass a single
--extra-resourcesargument — either one YAML file containing all theresources, or a directory of YAML files.