provider-helm icon indicating copy to clipboard operation
provider-helm copied to clipboard

Support semver 'constraint/query' in spec.forProvider.chart.version

Open SleepyBrett opened this issue 4 years ago • 1 comments

What problem are you facing?

Given the following release:

apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
  name: waas-helm-crossplane-release-example-stage-east
spec:
  deletionPolicy: Delete
  forProvider:
    chart:
      name: test
      repository: https://my.artifactory.foo/helmcharts
      version: ~0.1.1

It should respect the ~0.1.1 query and resolve the proper version to use. Right now I get an error like 'create failed: failed to install release: failed to load chart: stat /tmp/charts/test-~0.1.1.tgz: no such file or directory'

How could Crossplane help solve your problem?

It should conform with how the helm cli client resolves this issue.

I'll dig more into how the helm client code and see how they resolve this and perhaps prepare a pullrequest.

SleepyBrett avatar Sep 13 '21 17:09 SleepyBrett

Talking to a few people and spelunking the code found me this:

https://github.com/helm/helm/blob/main/pkg/downloader/chart_downloader.go#L247 which calls:

https://github.com/helm/helm/blob/db2485b20c8f53d802f4fc98c2f95e1fc0460d15/pkg/repo/index.go#L179

which resolves the semver constraint to an available version.

SleepyBrett avatar Sep 13 '21 21:09 SleepyBrett