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

Azure cr oci tags are not pulled when specifying semver in HelmChart or HelmRelease #3478

Closed
1 task done
andrewkreuzer opened this issue Jan 10, 2023 · 2 comments
Closed
1 task done

Comments

@andrewkreuzer
Copy link

Describe the bug

When specifying a semver in a HelmChart or HelmRelease the following error is thrown:

chart pull error: failed to get chart version for remote reference: 
could not get tags for "{{ some chart name }}": unable to locate any tags in 
provided repository: oci://{{ registry }}.azurecr.io/helm/{{some chart name}}

if a specific value is provided it will succeed:

pulled '{{ some chart name }}' chart with version 'v1.1.0'

I tested the provided example within the documentation using the podinfo oci://ghcr.io/stefanprodan/charts repo and it was able to pull chart 6.3.0 so looks as though this is an azure cr specific issue. I can work around this by creating image repo's and policies, updating the chart version with the image automation tools but it seems unnecessary if this should be a supported feature.

Steps to reproduce

  1. Upload helm chart as oci artifact to azure cr
  2. register helm repository with type oci
  3. reference helm repo in either HelmChart or HelmRepository
  4. Use a semver under spec.version

Expected behavior

Tags from oci repository are pulled and evaluated base on SemVer and Chart or Release is created successfully

Screenshots and recordings

No response

OS / Distro

ubuntu 20.04 LTS

Flux version

v0.38.3

Flux check

34 ► checking prerequisites
33 ✔ Kubernetes 1.24.6 >=1.20.6-0
32 ► checking controllers
31 ✔ helm-controller: deployment ready
30 ► ghcr.io/fluxcd/helm-controller:v0.28.1
29 ✔ image-automation-controller: deployment ready
28 ► ghcr.io/fluxcd/image-automation-controller:v0.28.0
27 ✔ image-reflector-controller: deployment ready
26 ► ghcr.io/fluxcd/image-reflector-controller:v0.23.1
25 ✔ kustomize-controller: deployment ready
24 ► ghcr.io/fluxcd/kustomize-controller:v0.32.0
23 ✔ notification-controller: deployment ready
22 ► ghcr.io/fluxcd/notification-controller:v0.30.2
21 ✔ source-controller: deployment ready
20 ► ghcr.io/fluxcd/source-controller:v0.33.0
19 ► checking crds
18 ✔ alerts.notification.toolkit.fluxcd.io/v1beta2
17 ✔ buckets.source.toolkit.fluxcd.io/v1beta2
16 ✔ gitrepositories.source.toolkit.fluxcd.io/v1beta2
15 ✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
14 ✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
13 ✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
12 ✔ imagepolicies.image.toolkit.fluxcd.io/v1beta1
11 ✔ imagerepositories.image.toolkit.fluxcd.io/v1beta1
10 ✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta1
9 ✔ kustomizations.kustomize.toolkit.fluxcd.io/v1beta2
8 ✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
7 ✔ providers.notification.toolkit.fluxcd.io/v1beta2
6 ✔ receivers.notification.toolkit.fluxcd.io/v1beta2
5 ✔ all checks passed

Git provider

No response

Container Registry provider

Azure cr

Additional context

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: azure-oci-repo
  namespace: flux-system
spec:
  interval: 1m0s
  type: oci
  url: oci://{{registry}}.azurecr.io/helm
  secretRef:
    name: {{secret}}

This is successful in pulling

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
  name: aaa-oci-repo-test
  namespace: flux-system
spec:
  interval: 5m0s
  chart: test-chart
  reconcileStrategy: ChartVersion
  sourceRef:
    kind: HelmRepository
    name: azure-oci-repo
  version: 'v1.1.0'

This is not

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
  name: aaa-oci-repo-test
  namespace: flux-system
spec:
  interval: 5m0s
  chart: test-chart
  reconcileStrategy: ChartVersion
  sourceRef:
    kind: HelmRepository
    name: azure-oci-repo
  version: '*' # or any of [ "v*", "v1.1.*", "v1.1.x"]

Code of Conduct

  • I agree to follow this project's Code of Conduct
@andrewkreuzer
Copy link
Author

This is out of scope of this project and the source controller as it seems to reside in the registry client used for oci repositories within the source controller. I'll direct my issue there. Sorry for the noise

@andrewkreuzer andrewkreuzer closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@andrewkreuzer
Copy link
Author

andrewkreuzer commented Jan 11, 2023

For anyone who finds this

The issue was our chart version was "v1.1.0". The prefixed "v" although valid using Masterminds/semver is not a "valid" semver. Changing our tag names to exclude the "v" fixed the issue.

I'm done for the day as I feel dumb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant