Skip to content

[BUG] transfer-pvc: validate/default destination storage class before creating the destination PVC #996

Description

@nachandr

What version of crane are you running, and what are your clutsters+platform
latest on main branch on OCP clusters

Summary
crane transfer-pvc copies the source PVC's storageClassName onto the
destination PVC and only overrides it when --dest-storage-class is passed. When
the destination cluster has no storage class of that name — always the case across
providers (e.g. AWS→GCP), where class names don't overlap — the destination PVC is
created but never binds, the mover pod stays Pending, and the run fails after a
5-minute pod-start timeout with an error that gives no indication of the cause.

There is no pre-flight validation that the destination storage class actually exists
on the destination cluster.

I believe this is applicable to both direct and indirect migration.

Steps to Reproduce

  1. Create a source PVC mysql-data on gp3-csi with some data, in a namespace
    present on both clusters.

  2. Run an indirect transfer without --dest-storage-class:

    crane transfer-pvc \
      --source-context      <src> \
      --destination-context <tgt> \
      --pvc-name            mysql-data \
      --pvc-namespace       indirect-rclone-secret-mysql:indirect-rclone-secret-mysql \
      --cloud-storage       remote:<bucket> \
      --rclone-config-secret <secret>

Actual Result
Upload succeeds; download times out and the run aborts:

[3/6] Uploading data to cloud storage ... ok
[4/6] Downloading data from cloud storage ...
[6/6] Cleaning up transfer pods ... ok
Error: download pod failed: timed out waiting for pod
indirect-rclone-secret-mysql/rclone-download-mysql-data to start:
context deadline exceeded

What did you expect to happen?
Before creating the destination PVC or any pod, crane should either:

  • Validate + fail fast, with a clear message naming the missing storage class and
    listing valid alternatives, or
  • Default to the destination cluster's default storage class when the copied
    source class is absent, logging the substitution.

Please include any relevant logs or errors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions