Skip to content

Deleting from a nonexistent OCI layout creates the layout #2377

Done

Description

@TanvirTian

What happened in your environment?

When I run oras manifest delete or oras blob delete against a path that does not exist, ORAS creates the OCI layout directory and its files (oci-layout and index.json).

This happens even when the requested artifact does not exist. The delete operation unexpectedly modifies the filesystem.

What did you expect to happen?

ORAS should report that the artifact or layout is missing without creating any directories or files.

How can we reproduce it?

Run these commands in a directory where missing-layout does not exist:

oras manifest delete --force --oci-layout missing-layout:v1

oras blob delete --force --oci-layout missing-layout@sha256:0000000000000000000000000000000000000000000000000000000000000000

After running either command, the missing-layout directory is created with oci-layout and index.json.

The same behavior can be reproduced using --oci-layout-path:

oras manifest delete --force --oci-layout-path ./missing-layout v1

What is the version of your ORAS CLI?

1.4.0

What is your OS environment?

CachyOS Linux (x86_64).

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    triage
    on Nov 26, 2026
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

    bugtriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions