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

Git Tag and Chart Version assumed to match #1766

Closed
runyontr opened this issue Jun 1, 2023 · 0 comments · Fixed by #1892
Closed

Git Tag and Chart Version assumed to match #1766

runyontr opened this issue Jun 1, 2023 · 0 comments · Fixed by #1892

Comments

@runyontr
Copy link
Contributor

runyontr commented Jun 1, 2023

Steps to reproduce

Create a zarf.yaml with this component:

  - name: dcgm-exporter
    required: true
    charts:
    - name: dcgm-exporter
      version: 3.1.7-3.1.4 # <- this tag doesn't match the chart version
      url: https://github.com/NVIDIA/dcgm-exporter.git
      gitPath: deployment
      namespace: "leapfrogai"
    images:
      - "nvcr.io/nvidia/k8s/dcgm-exporter:3.1.7-3.1.4-ubuntu20.04"

This particular application has a mismatch between the git tag and the chart version. This causes an error in either one of two ways since those two are assumed to match:

  1. Build error: If using the version matching the chart version, the package doesn't build since Zarf can't find the Git Tag
  2. Deploy Error: If using the git tag, zarf can't deploy the chart since it can't find a chart with the provided version

Expected result

Be able to deploy an arbitrary chart version from a git repository

Actual Result

Visual Proof (screenshots, videos, text, etc)

Severity/Priority

Additional Context

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

Ideas/for implementation:

  1. Add new property to the charts that allows for setting gitVersion separately from version, but have the default gitVersion match the version field
  2. Add more robust regex on the url to allow for passing branch/tag versions in the URL. Some ambiguity here on backwards compatibility. If nothing is set, does it default to the default branch, or the version?
  3. Don't have zarf check to ensure the version matches when deploying a chart from git.
Racer159 added a commit that referenced this issue Jul 11, 2023
## Description

What we could do (to keep backwards compat in tact and address
#1766) is see if there is
an @ ref on the git URL and if there is, leave it on there, and if not
append the @tag as we do today. Dedup some code in
src/pkg/packager/prepare.go, and src/pkg/packager/create.go.

## Related Issue

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

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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 <cmwylie19@defenseunicorns.com>
Signed-off-by: razzle <harry@razzle.cloud>
Co-authored-by: razzle <harry@razzle.cloud>
Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
Co-authored-by: Jon <jonsmith04@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant