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

Some Charts have unexpected names #106

Open
kferrone opened this issue Aug 27, 2021 · 2 comments
Open

Some Charts have unexpected names #106

kferrone opened this issue Aug 27, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@kferrone
Copy link

What happened?

I attempted to install the strimzi operator using the Helm Release from Crossplane. I get the following error when crossplane attempts to install the chart:

   - lastTransitionTime: '2021-08-27T15:55:40Z'
      message: >-
        create failed: failed to install release: failed to load chart: stat
        /tmp/charts/strimzi-kafka-operator-0.25.0.tgz: no such file or directory
      reason: ReconcileError
      status: 'False'
      type: Synced

Aaron Eaton helped me on Slack find the real problem.
He discovered the strimzi chart;

  • creates a file named: strimzi-kafka-operator-helm-3-chart-0.25.0.tgz
  • however provider-helm is expecting strimzi-kafka-operator-0.25.0.tgz

He also discovered a workaround where you can set the spec.forProvider.chart.url directly to the source, I have this commented out in the snippet below.

How can we reproduce it?

apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
  name: kafka-operator
spec:
  forProvider:
    chart:
      name: strimzi-kafka-operator
      repository: https://strimzi.io/charts
      # use url instead of repository as a workaround
      # url: https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.25.0/strimzi-kafka-operator-helm-3-chart-0.25.0.tgz
      version: 0.25.0
    namespace: strimzi
    skipCreateNamespace: false
    values:
      watchAnyNamespace: true

What environment did it happen in?

Crossplane version: 1.3.0
Helm Provider version: v0.9.0-rc

@kferrone kferrone added the bug Something isn't working label Aug 27, 2021
@AaronME
Copy link

AaronME commented Aug 27, 2021

The pullAndLoadChart function is hard-coding a naming convention which at least one helm chart is not honoring. See

filename := fmt.Sprintf("%s-%s.tgz", spec.Name, spec.Version)

We could update pullChart to either rewrite chart names to the expected format or return the actual chartname and use that throughout the rest of the provider.

Ref:

func (hc *client) pullChart(spec *v1beta1.ChartSpec, creds *RepoCreds, chartDir string) error {

@ksawerykarwacki
Copy link

Any chance for this to be fixed? Currently the only way to keep that consistent in composition is to patch manually the url and pray that strimzi (or any other chart provider) won't change naming schema. Couldn't we just use the correct url and add optional flag to switch between those two approaches?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants