Context
Follow-up to #186. Depends on #188 and #256 being completed first.
Cluster-scoped resources (ClusterRole, ClusterRoleBinding, CRDs, etc.)
exported by crane export are currently not fully supported through the
transform and apply stages. This issue tracks making them first-class
citizens in the full pipeline.
Goal
Ensure cluster-scoped resources pass through export → transform → apply
correctly: handled by transform plugins, rendered by kustomize, and written
to a deterministic output layout that separates them from namespaced resources.
Functional requirements
- Cluster-scoped resources from export must be consumed by transform — not
skipped, misclassified, or assigned a fake namespace like default
- Transform plugins (especially
KubernetesPlugin) must handle resources
with empty metadata.namespace correctly
- Generated patch targets for cluster-scoped resources must omit
namespace
crane apply must place cluster-scoped resources under
output/resources/_cluster/ and namespaced resources under
output/resources/<namespace>/
kubectl kustomize must succeed on every produced stage with mixed
namespaced + cluster-scoped inputs
- Whiteout and patch filtering logic must work for cluster-scoped resources
- Filenames and paths must be deterministic across reruns
- Recursive
kubectl apply -R -f output/ must work for the produced layout
crane apply must support a --skip-cluster-scoped flag that excludes
cluster-scoped resources from the rendered output (for non-admin migration
scenarios where the user cannot apply cluster-level objects)
Acceptance criteria
Context
Follow-up to #186. Depends on #188 and #256 being completed first.
Cluster-scoped resources (ClusterRole, ClusterRoleBinding, CRDs, etc.)
exported by
crane exportare currently not fully supported through thetransformandapplystages. This issue tracks making them first-classcitizens in the full pipeline.
Goal
Ensure cluster-scoped resources pass through
export → transform → applycorrectly: handled by transform plugins, rendered by kustomize, and written
to a deterministic output layout that separates them from namespaced resources.
Functional requirements
skipped, misclassified, or assigned a fake namespace like
defaultKubernetesPlugin) must handle resourceswith empty
metadata.namespacecorrectlynamespacecrane applymust place cluster-scoped resources underoutput/resources/_cluster/and namespaced resources underoutput/resources/<namespace>/kubectl kustomizemust succeed on every produced stage with mixednamespaced + cluster-scoped inputs
kubectl apply -R -f output/must work for the produced layoutcrane applymust support a--skip-cluster-scopedflag that excludescluster-scoped resources from the rendered output (for non-admin migration
scenarios where the user cannot apply cluster-level objects)
Acceptance criteria
transform and appear in
output/resources/_cluster/output/resources/<namespace>/--skip-cluster-scopedflag omits cluster-scoped resources from outputmigration works end to end