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

GetAvailablePackageSummaries returns empty list from OCI Registry #7269

Open
kvaps opened this issue Jan 3, 2024 · 2 comments
Open

GetAvailablePackageSummaries returns empty list from OCI Registry #7269

kvaps opened this issue Jan 3, 2024 · 2 comments
Labels
component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux kind/bug An issue that reports a defect in an existing feature

Comments

@kvaps
Copy link
Contributor

kvaps commented Jan 3, 2024

Describe the bug

Catalog is empty when using FluxCD and OCI Registry.

To Reproduce
Steps to reproduce the behavior:

Install Kubeapps with FluxCD

Create:

---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: podinfo
spec:
  interval: 1m0s
  url: oci://ghcr.io/stefanprodan/charts
  type: "oci"
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmChart
metadata:
  name: podinfo
  namespace: default
spec:
  interval: 5m0s
  chart: podinfo
  reconcileStrategy: ChartVersion
  sourceRef:
    kind: HelmRepository
    name: podinfo
  version: '6.*'

Open Catalog, you'll get an empty list.

Request to /apis/kubeappsapis.core.packages.v1alpha1.RepositoriesService/GetPackageRepositorySummaries
reutrns:

 grpc-message:
grpc-status: 0

Expected behavior

  • Available podinfo chart in Catalog

Screenshots

Screenshot 2024-01-03 at 23 15 40

Desktop (please complete the following information):

  • Version v2.9.0
  • Kubernetes version v1.29.0-rc.1
  • Package version:
flux: v2.0.1
helm-controller: v0.36.2
image-automation-controller: v0.36.1
image-reflector-controller: v0.30.0
kustomize-controller: v1.1.1
notification-controller: v1.1.0
source-controller: v1.1.2

Additional context
Add any other context about the problem here.

@kvaps kvaps added the kind/bug An issue that reports a defect in an existing feature label Jan 3, 2024
@kvaps kvaps changed the title GetAvailablePackageSummaries returns empty from OCI Registry GetAvailablePackageSummaries returns empty list from OCI Registry Jan 3, 2024
@kvaps
Copy link
Contributor Author

kvaps commented Jan 3, 2024

Also if you try to install helmchart using CLI:

---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: podinfo
  namespace: default
spec:
  interval: 10m
  timeout: 5m
  chart:
    spec:
      chart: podinfo
      version: '6.5.*'
      sourceRef:
        kind: HelmRepository
        name: podinfo
      interval: 5m
  releaseName: podinfo
  install:
    remediation:
      retries: 3
  upgrade:
    remediation:
      retries: 3
  test:
    enable: true
  values:
    replicaCount: 2

It will snow There is a problem with this package: this package has missing information, some actions might not be available.. warngin and not allow to upodate the release via Kubeapps:

Screenshot 2024-01-03 at 23 21 18

From the flux side, all the resources are ok:

# k get helmchart
NAME              CHART     VERSION   SOURCE KIND      SOURCE NAME   AGE   READY   STATUS
default-podinfo   podinfo   6.5.*     HelmRepository   podinfo       22m   True    pulled 'podinfo' chart with version '6.5.4'
podinfo           podinfo   6.*       HelmRepository   podinfo       27m   True    pulled 'podinfo' chart with version '6.5.4'
# k get helmrepository
NAME      URL                                 AGE   READY   STATUS
podinfo   oci://ghcr.io/stefanprodan/charts   27m   True    Helm repository is ready
# k get helmreleases
NAME      AGE   READY   STATUS
podinfo   26m   True    Release reconciliation succeeded

@antgamdia antgamdia added the component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux label Jan 8, 2024
@antgamdia antgamdia added this to the Technical debt milestone Jan 8, 2024
@antgamdia
Copy link
Contributor

Thanks for filing the issue and providing information on how to repro it. I've been having a quick look at the issue and, yep, I can reproduce it. I'd say it is happening because of how Flux marks the repo as "ready" (source):

Because the OCI Helm repository is a data container, there’s nothing to report for READY and STATUS columns above. The existence of the object can be considered to be ready for use.

However, our logs show:

I0108 17:32:17.537549 1 repo.go:576] Skipping packages for repository [helmrepositories:default:podinfo] because it is not in 'Ready' state

It seems we wrongly have assumed a "ready" state would eventually pop up:

log.Infof("Skipping packages for repository [%s] because it is not in 'Ready' state", key)

I assume (not 100% sure, though) adding this scenario ("a HelmRepo not explicitly ready, but pointing to an OCI repo") here would make the trick:

func isHelmRepositoryReady(repo sourcev1.HelmRepository) (complete bool, success bool, reason string) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/plugin-flux Issue related to kubeapps plugin to manage Helm charts via Flux kind/bug An issue that reports a defect in an existing feature
Projects
Status: 🗂 Backlog
Development

No branches or pull requests

2 participants