You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build-scripts/components/README.md
+58-6Lines changed: 58 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,62 @@ build-scripts/
20
20
binaries should be placed, second is the component version
21
21
pre-patch.sh <-- runs as `pre-patch.sh`. takes any action needed before applying
22
22
the component patches
23
-
patches/
24
-
... <-- list of patches to apply after checkout (for stable versions)
25
-
pre-patches/
26
-
... <-- list of patches to apply after checkout (for pre-releases)
27
-
strict-patches/
28
-
... <-- list of patches to apply when building strictly confined snap
23
+
patches/ <-- list of patches to apply after checkout (see section below)
24
+
...
25
+
strict-patches/ <-- list of extra patches to apply when building strictly confined snap
26
+
...
29
27
```
28
+
29
+
## Applying patches
30
+
31
+
Most MicroK8s components are retrieved from an upstream source (specified in the `repository`), with a specific tag (specified in `version.sh`), have some patches applied to them (from the `patches/` and `strict-patches/` directories) and are then built (using `build.sh`).
32
+
33
+
34
+
This section explains the directory format for the `patches` and `strict-patches` directories. The same rules apply for both. Note that the `strict-patches` (if any) are applied **after** any `patches` have been applied.
35
+
36
+
Our patches do not frequently change between versions, but they do have to be rebased from time to time, which breaks compatibility with older versions. For that reason, we maintain a set of patches for each version that introduces a breaking change. Consider the following directory structure for the Kubernetes component.
37
+
38
+
```
39
+
patches/default/0.patch
40
+
patches/v1.27.0/a.patch
41
+
patches/v1.27.0/b.patch
42
+
patches/v1.27.4/c.patch
43
+
patches/v1.28.0/d.patch
44
+
patches/v1.28.0-beta.0/e.patch
45
+
```
46
+
47
+
The Kubernetes version to build may be decided dynamically while building the snap, or be pinned to a specified version. The following table shows which patches we would apply depending on the Kubernetes version that we build:
48
+
49
+
| Kubernetes version | Applied patches | Explanation |
When a new release comes out which is no longer compatible with the existing latest patches, simply create a new directory under `patches/` with the new version number. This ensures that previous versions will still work, and newer ones will pick up the fixed patches.
0 commit comments