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

Zarf publishes empty packages to private repo when package name is not specified #2702

Open
Ansible-man opened this issue Jul 8, 2024 · 2 comments

Comments

@Ansible-man
Copy link

Ansible-man commented Jul 8, 2024

Environment

Device and OS: RHEL9
App version: 0.35.0
Kubernetes distro being used: RKE2
Other:

Steps to reproduce

  1. Build a zarf package
  2. Publish a package to a private repo without specifying the package name- zarf package publish /path/to/my/package/ oci://my-private-registry/zarfrepo --insecure
  3. Attempt to pull the package down with zarf package pull oci://my/private/registry/zarfrepo/packagename:tag --insecure
  4. After seeing that fails check the size in the repo
  5. Publish package by specifying the package name - zarf package publish /path/to/my/package/my-package.tar.zst oci://my-private-registry/zarfrepo/ --insecure
  6. Attempt to clone and it will work

Expected result

If only one package exists in the directory zarf detects it and pushes it to the private registry successfully

Actual Result

zarf acts like it published the package with the correct name and information but it is a shell with nothing in it that you cannot pull

Visual Proof (screenshots, videos, text, etc)

unable
pushing without the package name the size in the registry is 6Kibs
pushing it when specifying the package name the size is 395Mibs

Severity/Priority

medium

Additional Context

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

@phillebaba phillebaba added bug 🐞 Something isn't working possible-bug 🐛 and removed possible-bug 🐛 bug 🐞 Something isn't working labels Jul 11, 2024
@phillebaba
Copy link
Member

This may be some confusion in what publish does does for different source types. When you pass a directory as the argument you are pushing up a skeleton package which does not contain any of the package resources.

Skeleton packages have not been run through the zarf package create process yet, and thus do not have any remote resources included (no images, repos, or remote manifests and files) thereby retaining any create-time package configuration templates as they were defined in the original zarf.yaml (i.e. untemplated).

https://docs.zarf.dev/faq/#what-is-a-skeleton-zarf-package

I do understand that it can be confusing as the behavior depends on the input to the command. While the CLI output gives some indication that you have created a skeleton package I think that it could be a bit more clear.

@Ansible-man
Copy link
Author

Would it a good idea to add a flag to allow zarf publish to publish a zarf packages found in a directory when a directory is passed as the argument? If not I see no reason not to close this issue. Thank you for the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants