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)
Description
HelmReleasespec supports cross-namespace references, which allows sharing a singleHelmRepositoryfrom a central namespace. This is pretty convenient in management environments.This is a dummy example to make my point:
However, when
source-controllergenerates the correspondingHelmChart, the namespace from thesourceRefis not preserved becauseHelmChart.spec.sourceRefusesLocalHelmChartSourceReference, which does not support namespaces.The generated
HelmChartends up with this spec, and the namespace is the one of the sourceRef resource instead of the one of theHelmRelease:This is a bit confusing because
HelmReleaseallows specifying a namespace in the reference, but the generatedHelmChartcannot represent the same information. It would be nice to improve theHelmChartCRD spec sospec.sourceRefalso supports cross-namespace references and can preserve the originalsourceReffrom theHelmRelease.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)