Skip to content

Fix: crane export does not write clusterroles.yaml to failures/ directory #28

Description

@midays

Summary

When running crane export as a namespace-admin, the export correctly attempts to
collect ClusterRoles but filters them all out (0 of N matched). However, clusterroles.yaml
is not written to the failures/ directory, even though a generic
"Failed to collect cluster-scoped resources" error is logged.

Expected behavior

failures/<namespace>/clusterroles.yaml should be written whenever crane attempts
to export ClusterRoles and fails or finds 0 matching resources, so callers can
distinguish between "not attempted" and "attempted but nothing matched/accessible".

Actual behavior

The failures/ directory contains entries for other resource types but is missing
clusterroles.yaml. The log shows:

  • "Filtering for kind ClusterRole (299 found)"
  • "After filtering 0 remained out of 299"
  • "Failed to collect cluster-scoped resources; check the failures/ directory for details"

But no clusterroles.yaml is produced in failures/.

Impact

MTA-853 (split apply test) fails at the verification step because it relies on
clusterroles.yaml being present in failures/ to confirm that the namespace-admin
export correctly could not export cluster-scoped resources.

Repo

migtools/crane

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions