opcr-io / policy

CLI for building OPA policies into OCI images
https://www.openpolicycontainers.com
Apache License 2.0
215 stars 12 forks source link

[feature] Add possibility to untar policy content to the disk when pulling OCI from registry. #107

Open ievgenii-shepeliuk opened 1 year ago

ievgenii-shepeliuk commented 1 year ago

Hello

It could be very useful to add --untar / --untardir flags to policy pull command. So, the policy content could be retrieved to disk at one step, i.e.

policy pull --untar --untardir ~/policices .....`

Currently, to get raw sources from the policy OCI container, one need to execute 3 commands

policy pull ...
policy save ...
tar ...

The similar flags are implemented in helm pull command of Helm and it inspired the creation of this feature request.

Usage:
  helm pull [chart URL | repo/chartname] [...] [flags]
Flags:
      --untar                      if set to true, will untar the chart after downloading it
      --untardir string            if untar is specified, this flag specifies the name of the directory into which the chart is expanded (default ".") 
ogazitt commented 1 year ago

Thanks @ievgenii-shepeliuk!

This is indeed a useful enhancement and we will put it on our backlog. Or, feel free to submit a PR! :)