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 files archive path support #1928

Closed
Racer159 opened this issue Jul 28, 2023 · 1 comment · Fixed by #1962
Closed

Zarf files archive path support #1928

Racer159 opened this issue Jul 28, 2023 · 1 comment · Fixed by #1962
Assignees
Labels
enhancement ✨ New feature or request
Milestone

Comments

@Racer159
Copy link
Contributor

Racer159 commented Jul 28, 2023

Is your feature request related to a problem? Please describe.

Often binaries or other files that need to be included in a Zarf package are contained inside of archives (zip / tar) and need to be extracted to be used. This currently requires an additional script or action which clutters the zarf.yaml.

Describe the solution you'd like

  • Given I have a zarf.yaml that specifies a file archive
  • And I specify an archivePath
    files:
      - source: https://github.com/weaveworks/eksctl/releases/download/v0.146.0/eksctl_Darwin_amd64.tar.gz
        target: ~/.zarf/bin/eksctl
        shasum: 2e3faa90e3adf639aed4dbefd7691f73f4b2a21d64d907e6bdbc086cd79bf275
        archivePath: eksctl
  • When I create the package
  • Then the archive is extracted and only the internal file or directory is included in the package
  • And the SHASUM I provide would be that of the source archive

Describe alternatives you've considered

We could add an addition unarchive action type (similar to wait) but this action is not normally life cycle specific and likely would not make sense being done in this way.

Additional context

Common binaries like flux are distributed this way and in use in zarf packages today: https://github.com/defenseunicorns/uds-package-dubbd/blob/6c00497870b7bed3ce1b03554705b20dda746c41/defense-unicorns-distro/zarf.yaml#L138

@Racer159 Racer159 added the enhancement ✨ New feature or request label Jul 28, 2023
@Racer159 Racer159 added this to the (2023.08.15) milestone Jul 28, 2023
@cmwylie19 cmwylie19 self-assigned this Aug 7, 2023
@cmwylie19
Copy link
Contributor

This works for files, and folders including non-urls

      - source: hi.tar.gz
        target:  something/hi.txt
        shasum: aadc1955c030f723e9d89ed9d486b4eef5b0d1c6945be0dd6b7b340d42928ec9
        archivePath: hi.txt

Racer159 added a commit that referenced this issue Aug 27, 2023
## Description

Add support for ArchivePath which can be a file or a folder in Zarf
Package

## Related Issue

Fixes #1928 
<!-- or -->
Relates to #

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Signed-off-by: Case Wylie <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Wayne Starr <[email protected]>
Co-authored-by: Wayne Starr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants