Skip to content

[BUG] transfer-pvc[indirect mode]: non-existent rclone config file orphans the destination PVC #899

Description

@nachandr

Summary
crane transfer-pvc reads and validates the --rclone-config-file after it
has already created the destination PVC on the destination cluster. So any
config-file failure — the file is missing/unreadable, or (with --encrypt) it
already contains an [encrypted] section — is reported only after a remote side
effect has been committed.

What version of crane are you running, and what are your clutsters+platform
v0.11.0-alpha.1 + OCP

What did you expect to happen?
PVC on the destination cluster should be removed

What actually happened?
PVC on the destination cluster doesn't get removed

Steps to reproduce

$ crane transfer-pvc \
    --source-context kind-source-cluster \
    --destination-context kind-dest-cluster \
    --pvc-name enctest:orphan-check \
    --pvc-namespace default:default \
    --encrypt \
    --cloud-storage remote:bucket \
    --rclone-config-file /tmp/nope.conf

[1/6] Reading source PVC ...
[1/6] Reading source PVC ... ok
[2/6] Creating destination PVC ...
[2/6] Creating destination PVC ... ok        <-- side effect committed
Error: failed to read rclone config file /tmp/nope.conf: open /tmp/nope.conf: no such file or directory
--- exit=1

$ kubectl --context kind-dest-cluster -n default get pvc orphan-check
NAME           STATUS    ...
orphan-check   Pending   ...                 <-- orphaned

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

Labels

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

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions