feat: publish the Helm chart on release - #35
Conversation
The chart machinery inherited from awx-operator was never wired to a workflow here, so the chart could only be built by hand and there was no repository to install it from. A release now packages the chart, attaches it to the release, and refreshes index.yaml on the gh-pages branch, which makes the repository servable from GitHub Pages at https://ctrliq.github.io/ascender-operator. The chart is named ascender-operator and its image is the one this repository publishes.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
How is the internal one different from this? I was working on converting that one over here |
|
Hi @cigamit, thanks for the pointer. They are the same chart. So this PR does not write a chart. It rebrands what the generator already emits, which is the whole 7 line Makefile diff, and adds the missing The That leaves a choice rather than a difference: generate the chart here, or move your fork into |
Addresses ctrliq/ascender-install#181, which asks for an official Helm repository for the operator. Issues were disabled here when it was filed, so the request landed on the installer repo.
Problem
The chart machinery is all here already, inherited from awx-operator:
.helm/starter, and thehelm-chart,helm-packageandhelm-indextargets in the Makefile. Nothing calls it. The chart is still namedawx-operatorand points at the upstream repository, and no workflow publishes it, so there is no repository tohelm repo addand the operator can only be installed with kustomize.Change
Releases now publish the chart:
.github/workflows/publish-helm.yamlruns when a release is published, or on demand for a given tag. It packages the chart at the release version, attaches the tarball to the release, and refreshesindex.yamlon thegh-pagesbranch. The branch is created on the first run when it does not exist yet.ascender-operator, and the three places that spelledawx-operatorout use$(CHART_NAME)instead.helm-indexnow depends on thehelmtarget so it can be run on its own.The chart index lists each version with the URL of the tarball attached to that release, which is the layout the chart README already describes. Nothing about the generated manifests changes:
namePrefixstaysawx-operator-, so resource names inside the chart are the same as with kustomize.Once this merges, the repository needs GitHub Pages pointed at the
gh-pagesbranch, root folder, and the chart is then available with:Older releases have no chart attached, so
helm-indexskips them and the index starts at the first release published with this workflow.Testing
Run locally against this branch with
VERSION=0.0.0-test:make helm-chartgeneratescharts/ascender-operatorwith the CRDs incrds/and the operator manifests intemplates/make helm-packageproducesascender-operator-0.0.0-test.tgz, andhelm lintpasses on the charthelm templaterenders the deployment withimage: ghcr.io/ctrliq/ascender-operator:0.0.0-testmake helm-index CHART_OWNER=ctrliqskips the existing releases that carry no chart and writes an index whose entry URL ishttps://github.com/ctrliq/ascender-operator/releases/download/0.0.0-test/ascender-operator-0.0.0-test.tgzThe workflow itself has not run, since that needs a release in this repository.