Skip to content

~/.zarf-cache/images does not automatically get created #4735

@vincent-defenseunicorn

Description

@vincent-defenseunicorn

Environment

Device and OS:
App version:
Kubernetes distro being used:
Other: Zarf 0.74.0

Steps to reproduce

# Setup the environment
cat > zarf.yaml << 'EOF'
# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json
kind: ZarfPackageConfig
metadata:
  name: hello-world
  version: "###ZARF_PKG_TMPL_VERSION###"
  description: "hello world"
components:
  - name: hello-world
    required: true
    imageArchives:
      - path: images.tar
        images:
          - alpine:###ZARF_PKG_TMPL_VERSION###
    images: []
EOF
docker image pull alpine:latest
docker save alpine:latest -o images.tar

# Attempt to create the Zarf package
zarf package create . --confirm --set version=latest --architecture=amd64 --zarf-cache test-zarf-cache

# Running this will fix it
mkdir -p test-zarf-cache/images

# Rerun the zarf package create
zarf package create . --confirm --set version=latest --architecture=amd64 --zarf-cache test-zarf-cache

Expected result

If the --zarf-cache directory does not include an images subdirectory and needs it, it will automatically be created by zarf

Actual Result

You get an error saying something along the lines of:

2026-03-20 15:37:12 ERR failed to create package: failed to generate SBOM: failed to create image sbom: unable to create layer cache dir="test-zarf-cache/images/sha256:989e799e634906e94dc9a5ee2ee26fc92ad260522990f26e707861a5f52bf64e" : open test-zarf-cache/images/sha256:989e799e634906e94dc9a5ee2ee26fc92ad260522990f26e707861a5f52bf64e: no such file or directory

Visual Proof (screenshots, videos, text, etc)

Severity/Priority

Additional Context

Add any other context or screenshots about the technical debt here.

Metadata

Metadata

Assignees

Labels

bug 🐞Something isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions