Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crane: make delete idempotent #1862

Open
rgl opened this issue Jan 14, 2024 · 1 comment
Open

crane: make delete idempotent #1862

rgl opened this issue Jan 14, 2024 · 1 comment
Labels
bug Something isn't working lifecycle/stale

Comments

@rgl
Copy link

rgl commented Jan 14, 2024

Describe the bug

When using crane to delete images inside some kind of automation pipeline, it would be nice if crane delete would consider non-existent deletes as a successful result instead of erroring out.

This would be useful when a Human manually deletes a image from a registry, and later, the automation that calls crane will also try to delete that image. In this case, since the image is already deleted, crane should accept that as a successful result.

To Reproduce

  1. Upload/Copy an image to a ECR repository, e.g.: crane copy "$source_image" "$target_image".
  2. As a Human, at the ECR repository, delete the uploaded image.
  3. Delete the image using crane, e.g.: crane delete "$target_image".
  4. See crane error out with: MANIFEST_UNKNOWN: Requested image not found.

Expected behavior

Since the image is already deleted, crane delete should consider that case as a non-error, and return successfully.

Additional context

The full example is at https://github.com/rgl/pulumi-typescript-aws-native-ecr-example. The crane delete command is at https://github.com/rgl/pulumi-typescript-aws-native-ecr-example/blob/main/ecr-image.sh (which is called from https://github.com/rgl/pulumi-typescript-aws-native-ecr-example/blob/main/images.ts (look for ecr-image.sh for the exact place)).

  • Output of crane version: 0.17.0
  • Registry used: ECR
@rgl rgl added the bug Something isn't working label Jan 14, 2024
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lifecycle/stale
Projects
None yet
Development

No branches or pull requests

1 participant