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

Using local image archives no longer works #2181

Open
rjferguson21 opened this issue Dec 7, 2023 · 1 comment · May be fixed by #2303
Open

Using local image archives no longer works #2181

rjferguson21 opened this issue Dec 7, 2023 · 1 comment · May be fixed by #2303
Labels
bug 🐞 Something isn't working good first issue 🥇 Good for newcomers

Comments

@rjferguson21
Copy link
Contributor

Environment

Device and OS: Linux
App version: v0.31.0
Kubernetes distro being used: k3d
Other:

Steps to reproduce

  1. Create an image archive locally with docker save busybox -o busybox.tar
  2. Create a zarf.yaml that references the archive in the images: list for a component.
kind: ZarfPackageConfig
metadata:
  name: example
  description: Test component
  version: 1.0.0

components:
  - name: zebra
    description: "This is a zebra and they have stripes"
    images:
      - "/home/rob/busybox.tar"
  1. zarf package create . --confirm

Expected result

A package to be created that includes the referenced image archive.

Actual Result

Error indicating the package create has failed.

     ERROR:  Failed to create package: failed to create ref for image /home/rob/busybox.tar: invalid reference
             format

Visual Proof (screenshots, videos, text, etc)

2023-12-07_17-12-1701991967

Severity/Priority

Not critical

Additional Context

Originally added in #1173,

@Racer159 Racer159 added bug 🐞 Something isn't working good first issue 🥇 Good for newcomers and removed possible-bug 🐛 labels Jan 25, 2024
@Racer159
Copy link
Contributor

Validated that this is a bug and marked it as a good first issue as well since the logic just needs to be untangled.

Zarf currently supports .tar images here:

if strings.HasSuffix(src, ".tar") || strings.HasSuffix(src, ".tar.gz") || strings.HasSuffix(src, ".tgz") {
- this uses Crane to resolve the image reference and pull in the image.

This code will still do what we want for copying the image and it's layers but we will want to mutate the reference within the list of images in the zarf.yaml component so that Zarf can properly pull from its internal store on deploy. PullAll returns a "pulled" image info array that can be used to perform this check and update the references

pulled, err = imgConfig.PullAll()
. We'll also have to skip the parse image ref for the tarball since you wouldn't get one in this case: https://github.com/defenseunicorns/zarf/blob/main/src/pkg/packager/create_stages.go#L131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 🥇 Good for newcomers
Projects
Status: In progress
Status: No status
2 participants