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

Helm Chart.yaml based promotion not working #1281

Closed
geowalrus4gh opened this issue Dec 15, 2023 · 4 comments · Fixed by #1450
Closed

Helm Chart.yaml based promotion not working #1281

geowalrus4gh opened this issue Dec 15, 2023 · 4 comments · Fixed by #1450

Comments

@geowalrus4gh
Copy link

geowalrus4gh commented Dec 15, 2023

Description

I was trying to demonstrate helm-based promotion in the stage specification. This helm chart is an umbrella chart.
In this sample, I was trying Chart.yaml update for helm-based promotion. Subsciption configured with image based subscription and image version is displayed in the freight box. When i execute promotion, stage update shows successful but no commits are happening in the given branch. Here is the snippet from stage.yaml file.

stage.yaml

    promotionMechanisms:
    gitRepoUpdates:
    - repoURL: https://github.com/xyz/kargo-demo-deploy.git
      writeBranch: stage/test
      helm:
        charts:
          - name: kargo-demo-app-charts
            registryURL: oci://docker.io/xyz
            chartPath: helm/stages/test

Version

Client Version: v0.2.1
Server Version: v0.2.1
@geowalrus4gh geowalrus4gh changed the title Helm based promotion not working Helm Chart.yaml based promotion not working Dec 15, 2023
@krancour
Copy link
Member

krancour commented Dec 16, 2023

@geowalrus4gh helm/stages/test/Chart.yaml exists? Is there a chance I could see it, even if it's sanitized?

@krancour krancour self-assigned this Dec 16, 2023
@geowalrus4gh
Copy link
Author

yes. it exists. here is the yaml

apiVersion: v2
name: kargo-demo
description: A Helm chart for App Sample
type: application
version: 0.1.0
appVersion: 1.0.0
dependencies:
- name: kargo-demo-app-charts
  repository: oci://docker.io/xyz
  version: 0.1.14
  condition: kargo-demo-app-charts.enabled

@krancour
Copy link
Member

krancour commented Dec 18, 2023

That all looks ok to me. I'll try to reproduce this issue.

Do you see anything useful in the controller logs?

@krancour
Copy link
Member

@geowalrus4gh I did some digging it it all came back to me...

Here's an example of a subscription to a chart in an OCI registry working properly in our tests:

https://github.com/akuity/kargo/blob/main/internal/helm/helm_test.go#L98-L111

Note that we use oci://ghcr.io as the registryURL and akuity/kargo-charts/kargo as the chartName.

This is technically correct, as it does say "registry" and does not say "repository."

The oras library we're using for retrieving tags for the chart seems to be dogmatic about what part is "registry" and what part is "chart." If you get them wrong, the URLs it uses for talking to the registry will be malformed.

I suppose this precision of terms may seem jarring when Helm itself seems to play a bit fast and loose here.

dependencies:
- name: kargo-demo-app-charts
  repository: oci://docker.io/xyz
  version: 0.1.14

Helm allows the above, but terminology is being used incorrectly.

oci://docker.io/xyz is not an OCI repository. oci://docker.io/xyz/kargo-demo-app-charts is an OCI repository. 😬

Helm seems to be doing things this way for legacy reasons. Classic chart registries/repositories are structured differently than OCI registries/repositories are and if you look at everything through the lens of that legacy context, everything makes sense.

Note that if you re-write the example above like this, helm dependency update will fail:

dependencies:
- name: xyz/kargo-demo-app-charts
  repository: oci://docker.io
  version: 0.1.14

So, ultimately, even if you had everything configured correctly, there may end up being some kind of impedance here.

Kargo will look for and find registry oci://docker.io chart xyz/kargo-demo-app-charts, but when it tries to match it to an entry like the following in Chart.yaml, there won't be a match:

- name: kargo-demo-app-charts
  repository: oci://docker.io/xyz
  version: 0.1.14

I'll see if I can figure out how to make things a bit more forgiving.

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.

2 participants