Skip to content

[Feature Request] Support for cross-namespace sources in HelmChart CRD #2065

@joseluisgonzalezca

Description

@joseluisgonzalezca

Description

HelmRelease spec supports cross-namespace references, which allows sharing a single HelmRepository from a central namespace. This is pretty convenient in management environments.

This is a dummy example to make my point:

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: my-app
  namespace: app-namespace
spec:
  chart:
    spec:
      chart: my-chart
      sourceRef:
        kind: HelmRepository
        name: shared-repo
        namespace: shared-charts

However, when source-controller generates the corresponding HelmChart, the namespace from the sourceRef is not preserved because HelmChart.spec.sourceRef uses LocalHelmChartSourceReference, which does not support namespaces.

The generated HelmChart ends up with this spec, and the namespace is the one of the sourceRef resource instead of the one of the HelmRelease:

spec:
  sourceRef:
    kind: HelmRepository
    name: shared-repo

This is a bit confusing because HelmRelease allows specifying a namespace in the reference, but the generated HelmChart cannot represent the same information. It would be nice to improve the HelmChart CRD spec so spec.sourceRef also supports cross-namespace references and can preserve the original sourceRef from the HelmRelease.

Related context

There was a previous discussion about this behaviour and how to improve it. However, the described problem was not addressed at all and the original issue was closed without a valid response (#398)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions