Skip to content

feat: reconcile referencing helmchart if helmrelease is reconciled #3660

Closed
raffis wants to merge 3 commits intofluxcd:mainfrom
raffis:feat-reconcile-chart
Closed

feat: reconcile referencing helmchart if helmrelease is reconciled #3660
raffis wants to merge 3 commits intofluxcd:mainfrom
raffis:feat-reconcile-chart

Conversation

@raffis
Copy link
Contributor

@raffis raffis commented Mar 6, 2023

Current situation

flux reconcile hr my-release --with-source does not update the HelmChart (installed from an oci registry) if the version is a semver expression (like in this example *) and a new version of the chart was released meanwhile.
Meaning at the moment one has either to await the configured interval or manually annotate the referenced HelmChart in order to receive the new version.
I would expect that if I manually trigger a reconcile I get the latest version possible which is matched by semver which is not the case currently.

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: my-release
spec:
  chart:
    spec:
      chart: mychart
      interval: 15m0s
      sourceRef:
        kind: HelmRepository
        name: oci-repository
        namespace: flux-system
      version: '*'
  interval: 15m0s

Proposal

flux reconcile hr my-release --with-source should actually annotate the referenced helm chart as well.

This pr implements just that:

go run . reconcile hr my-release --with-source
► annotating HelmRepository oci-repository in default namespace
✔ HelmRepository annotated
◎ waiting for HelmRepository reconciliation
✔ Helm repository is ready
► annotating HelmRelease my-release in default namespace
✔ HelmRelease annotated
◎ waiting for HelmRelease reconciliation
✔ applied revision 4.0.11+1
► annotating HelmChart default-my-release in flux-system namespace
✔ HelmChart annotated
◎ waiting for HelmChart reconciliation
✔ fetched revision 4.0.12+1

raffis added 3 commits March 6, 2023 13:50
…th source

Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
@stefanprodan
Copy link
Member

stefanprodan commented Mar 7, 2023

IMO the chart should be reconciled before the HelmRelease as with all other sources. In the case a new chart is found, the HelmRelease gets reconciled automatically so now we reconcile it twice which is wrong... cc @hiddeco

@stefanprodan stefanprodan requested a review from hiddeco March 7, 2023 10:18
@raffis
Copy link
Contributor Author

raffis commented Mar 7, 2023

IMO the chart should be reconciled before the HelmRelease as with all other sources. In the case a new chart is found, the HelmRelease gets reconciled automatically so now we reconcile it twice which is wrong... cc @hiddeco

Makes sense, will change the order 👍🏻

@stefanprodan
Copy link
Member

stefanprodan commented Mar 7, 2023

@raffis I suggest you first implement #3656, then call the reconcileChart function in this PR.

@raffis
Copy link
Contributor Author

raffis commented Mar 9, 2023

@raffis I suggest you first implement #3656, then call the reconcileChart function in this PR.

superseded by #3675

@raffis raffis closed this Mar 9, 2023
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

Successfully merging this pull request may close these issues.

2 participants