imgpkg icon indicating copy to clipboard operation
imgpkg copied to clipboard

Allow directly pushing archives, in particular ZIP or JAR

Open voor opened this issue 3 years ago • 5 comments

Describe the problem/challenge you have In a popular workflow that enables a premade JAR to be accessible to Cartographer's source.image reference you actually need 2 steps:

  1. unzip the JAR file
  2. imgpkg push the contents of the JAR file. Several CLI implementations do this transparently, but those CLIs are serving other products primarily and do not offer a generic experience, in particular if you're not leveraging the products those CLIs are serving.

Describe the solution you'd like imgpkg push --archive that would detect a zip, jar, or maybe even tar and push those contents.


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help work on this issue.

voor avatar Aug 23 '22 11:08 voor

Hey @voor

Are you planning of using this feature with -f flag? It sounds like it could be a problem because files might overwrite themselves. Also, I assume that you will only want 1 archive per push, correct? I think that maybe these 2 flags should exclude each other.

Since you can unzip a jar file I think zip and jar could behave the same way, implementation-wise. But eventually, if it fails it could try to see if the file can be untared.

joaopapereira avatar Aug 24 '22 16:08 joaopapereira

The use case was exclusive use of --archive so if was mutually exclusive to -f that'd be fine.

voor avatar Aug 24 '22 17:08 voor

Sounds good, let us do that.

The flag --archive and -f are mutually exclusive. The flag --archive can only be used once.

Going to accept this issue. As always if anyone is interested in implementing this just let us know.

joaopapereira avatar Aug 24 '22 17:08 joaopapereira

idea for the flag name: --file-archive. this would put it into same category as --file so it would be more naturally discoverable.

cppforlife avatar Sep 15 '22 16:09 cppforlife

Hi, along with the JAR and zip, can this feature include the pushing of bundle.tar.gz? This bundle.tar.gz is just the compressed imgpkg directory. So, when a user pushes imgpkg.tar.gz it should get expanded and pushed as a bundle to the oci registry.

Contents of imgpkg.tar.gz:

examples/basic-step-2
├── .imgpkg
│   ├── bundle.yml
│   └── images.yml
└── helm.tgz

expected usage:

imgpkg push -b index.docker.io/user1/simple-app-bundle:v1.0.0 -f <my_imgpkg>.tar.gz

sabeer6870 avatar Nov 10 '22 21:11 sabeer6870