Skip to content

Commit

Permalink
Use fork main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fiunchinho committed Nov 20, 2023
1 parent 8a805ea commit cdddca5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ There are several ways to install this app onto a workload cluster.

## Upgrading cilium version

The contents of the `helm` folder are being generated by the `make` target called `make update-chart`.
The contents of the `helm` folder are being generated by the `make` target called `make update-chart`. You can use it like this

```
APPLICATION=cilium make update-chart
```

This target uses [`vendir`](https://carvel.dev/vendir/) to fetch the helm chart contained in [the fork of the cilium repository that we maintain](https://github.com/giantswarm/cilium-upstream).
Currently, the `main` branch on the fork contains the upstream tag `v1.14.3`, with our custom changes on top.

If you want to upgrade this `cilium-app` to use a newer version of cilium, you need to prepare our fork first. All changes are applied there, and then we use `vendir` to generate the contents of the `helm` folder.
If you want to upgrade this `cilium-app` to use a newer version of cilium, you need to prepare our fork first.
All changes are applied there, and then we use `vendir` to generate the contents of the `helm` folder in this repository.

We need to create a new branch on our fork based off the tag of the version we want to upgrade to. For example, if we want to upgrade to cilium `v1.14`, we need to create a new branch based off the upstream tag for the latest `v1.14` version, which is currently `v1.14.3`.
We need to create a new branch on our fork based off the tag of the version we want to upgrade to.
For example, if we want to upgrade to cilium `v1.14.3`, we need to create a new branch based off the upstream tag for that version.
```
git remote add upstream [email protected]:cilium/cilium.git
git fetch upstream
git checkout upstream/v1.14.3
git checkout -b update-to-1-14-3
```

Then we need to apply our custom changes on top of that new branch. Since those changes are already on the repository (although a different branch), we can use `cherry-pick` for apply those same commits to our newly created branch, for example
Then we need to apply our custom changes on top of that new branch.
Since those changes are already on the repository (although a different branch), we can use `cherry-pick` for apply those same commits to our newly created branch, for example
```
git cherry-pick a4b22dee87ba3663f967f6dd6d8e666c849c742d^..25c449534cc325a5798fc7c839b8ac33591b3516
```
Expand All @@ -39,12 +47,19 @@ helm schema-gen install/kubernetes/cilium/values.yaml > install/kubernetes/ciliu
```

Don't forget to commit the changes, if any.
Once we are done, we can push our new branch to our fork and it will be ready to be used by `vendir`.
Once we are done, we can push our new branch to our fork, and it will be ready to be used by `vendir` from here.

Then, in this repository, we need to update the `vendir` configuration in `vendir.yml` to use the new branch we just pushed, and run the make target `APPLICATION=cilium make update-chart`.
With the generated changes, let's create a new pull request so that everyone can review the changes that will be applied to the cilium chart.
If we need further customizations, we can keep adding commits on the new branch on the fork, and re-run `make update-chart` to update the generated files.
If we need further customizations, we can keep adding commits on the new branch on the fork, and re-run `APPLICATION=cilium make update-chart` here to update the generated files in the app.

Once we are happy with the changes, we need to make the `main` branch in our fork to point to our latest commit
```
git branch -f main
git checkout main
git push origin main -f
```

Once we are happy with the changes, we can merge the changes in the fork to the fork's `main` branch. After merging, the `main` branch in our fork should contain cilium latest release (`v1.14.3` on the example) with our customizations on top.
Then update our pull request to use the fork's `main` branch again, and merge it.
Finally, we just need to create a new release of this cilium-app.
After this, the `main` branch in our fork should contain cilium latest release (`v1.14.3` on the example) with our customizations on top.
Then update our pull request in this repository to use the fork's `main` branch again, and merge it.
Finally, we just need to create a new release of this `cilium-app`.
2 changes: 1 addition & 1 deletion vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ directories:
- path: cilium
git:
url: https://github.com/giantswarm/cilium
ref: "upgrade-1-14-3"
ref: "main"
includePaths:
- install/kubernetes/cilium/**/*
- path: helm/cilium
Expand Down

0 comments on commit cdddca5

Please sign in to comment.