knative / operator

Combined operator for Knative.
Apache License 2.0
187 stars 98 forks source link

Automatically create Helm index.yaml file for new release #1851

Open kromanow94 opened 1 month ago

kromanow94 commented 1 month ago

This is a continuation of my comments under https://github.com/knative/operator/issues/1525.

Problem The knative-operator is not released to any Helm Chart Repository. The Helm Charts exist in the artifacts but there is no Helm Chart Repository for knative-operator.

The simplest way of providing a Helm Chart Repository is to provide an index.yaml file directly to the git repository and use it with the raw url format.

Assuming the index.yaml file would exist in the main branch of this repository, the Helm Chart Repository URL would be:

https://raw.githubusercontent.com/knative/operator/main

I already created a PoC for this in my fork:

If this approach is accepted, I can contribute and create a PR with the script and GH Workflow that will execute this script and commit changes to the main branch.

Persona: System Operator

Exit Criteria When a new Helm Chart is released with the knative-operator releases, the index.yaml should be automatically updated with new release of Helm Chart. This can be achieved with the GitHub Action Workflow and a slightly modified script available here: kromanow94/knative-operator/find_helm_chart_releases_and_create_helm_index.py. The script modification requires only to get the GitHub Token as shown in example here: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow.

Time Estimate (optional): 1-3 days, depending on the feedback.

kromanow94 commented 1 month ago

@houshengbo what are your thoughts on this?

houshengbo commented 2 weeks ago

@kromanow94 I like this approach of creating index.yaml for the Helm charts. I was looking for the solution, but did not figure out.

One remark I have is that right now, all knative projects are using ./hack/release.sh and ./hack/generate-yamls.sh to generate the artifacts for releases. Try to put the code related to releases in there. And, do we have to use python? Shall we use script or even golang for https://github.com/kromanow94/knative-operator/blob/main/find_helm_chart_releases_and_create_helm_index.py? Just want to consistent with current source code.

kromanow94 commented 1 day ago

Hey, I created a new script using bash. Please see the script here find_helm_chart_releases_and_create_helm_index.sh.

I also changed the app version formatting to standardize the format to v.x.x.x.

This is now the new representation of the Helm Chart Repository in https://raw.githubusercontent.com/kromanow94/knative-operator/main:

NAME                                            CHART VERSION   APP VERSION     DESCRIPTION                              
kromanow94-knative-operator/knative-operator    v1.15.4         1.15.4          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.15.3         1.15.3          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.15.2         1.15.2          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.15.1         1.15.1          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.15.0         1.15.0          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.8         1.14.8          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.7         1.14.7          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.6         1.14.6          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.5         1.14.5          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.4         1.14.4          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.3         1.14.3          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.2         1.14.2          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.1         1.14.1          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.14.0         1.14.0          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.13.3         1.13.3          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.13.2         1.13.2          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.13.1         1.13.1          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.13.0         1.13.0          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.5         1.12.5          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.4         1.12.4          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.3         1.12.3          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.2         1.12.2          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.1         1.12.1          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.12.0         1.12.0          Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.11.12        1.11.12         Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.11.11        1.11.11         Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.11.10        1.11.10         Helm chart for deploying Knative Operator
kromanow94-knative-operator/knative-operator    v1.11.9         1.11.9          Helm chart for deploying Knative Operator

WDYT?