Skip to content

Commit a8e6ff2

Browse files
committed
Rabse 1.34.2 mvp
1 parent 22fae3e commit a8e6ff2

File tree

39 files changed

+641
-313
lines changed

39 files changed

+641
-313
lines changed

docs/content/contributing/guides/rebasing-kubernetes.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@
33
This describes the process of rebasing kcp onto a new Kubernetes version. For the examples below, we'll be rebasing
44
onto v1.33.3
55

6+
1. Create a new branch for the update, such as `1.34.2-prep` in main monorepo
7+
68
# 1. Update kcp-dev/apimachinery
79

8-
1. Create a new branch for the update, such as `1.31-prep`.
9-
2. Update go.mod:
10+
2. Go into the `staging/src/github.com/kcp-dev/apimachinery` directory.
11+
3. Update go.mod:
1012
1. You may need to change the go version at the top of the file to match what's in go.mod in the root of the
1113
Kubernetes repo. This is not required, but probably a good idea.
1214
2. Update the primary Kubernetes dependencies:
1315
```
14-
go get k8s.io/api@v0.31.0 k8s.io/apimachinery@v0.31.0 k8s.io/client-go@v0.31.0
16+
go get k8s.io/api@v0.34.2 k8s.io/apimachinery@v0.34.2 k8s.io/client-go@v0.34.2
1517
```
1618
3. Run `go mod tidy`.
17-
3. Manually review the code that is upstream from `third_party` and make the same/similar edits to anything that
19+
4. Manually review the code that is upstream from `third_party` and make the same/similar edits to anything that
1820
changed upstream. For example, we maintain a slightly modified copy of the
19-
[shared informer code](https://github.com/kubernetes/kubernetes/blob/v1.30.1/staging/src/k8s.io/client-go/tools/cache/shared_informer.go).
20-
4. Run `make lint test`. Fix any issues you encounter.
21-
5. Commit your changes.
22-
6. Push to your fork.
23-
7. Open a PR; get it reviewed and merged.
21+
[shared informer code](https://github.com/kubernetes/kubernetes/blob/v1.34.2/staging/src/k8s.io/client-go/tools/cache/shared_informer.go).
22+
5. Run `make lint test`. Fix any issues you encounter.
23+
6. Commit your changes so we have a clean commits for each step.
2424
2525
# 2. Update kcp-dev/code-generator
2626
27-
1. Create a new branch for the update, such as `1.26-prep`.
2827
2. Update `go.mod`:
2928
1. You may need to change the go version at the top of the file to match what's in go.mod in the root of the
3029
Kubernetes repo. This is not required, but probably a good idea.
3130
2. Update the primary Kubernetes dependencies:
3231
```
33-
go get k8s.io/apimachinery@v0.31.0 k8s.io/code-generator@v0.31.0
32+
go get k8s.io/apimachinery@v0.34.2 k8s.io/code-generator@v0.34.2
3433
```
3534
3. Run `go mod tidy`.
3635
3. Repeat step 2 for `examples/go.mod`:
@@ -42,33 +41,25 @@ onto v1.33.3
4241
2. If there were any substantive changes, make the corresponding edits to our generators.
4342
3. You'll probably want to commit your changes at this point.
4443
5. Run `make codegen`. You'll probably want to commit these changes as a standalone commit.
45-
6. Run `make lint test build` and fix any issues you encounter.
46-
7. Commit any remaining changes.
47-
8. Push to your fork.
48-
9. Open a PR; get it reviewed and merged.
44+
6. Run `make build` and fix any issues you encounter.
45+
7. Commit your changes so we have a clean commits for each step.
4946
5047
# 3. Update kcp-dev/client-go
5148
1. Create a new branch for the update, such as `1.26-prep`.
5249
2. Update go.mod:
5350
1. You may need to change the go version at the top of the file to match what's in go.mod in the root of the
5451
Kubernetes repo. This is not required, but probably a good idea.
55-
2. Update the `kcp-dev/apimachinery` dependency:
56-
```
57-
go get github.com/kcp-dev/apimachinery@main github.com/kcp-dev/code-generator@main
58-
```
59-
3. That should have updated the primary Kubernetes dependencies, but in case it didn't, you can do so manually:
52+
2. That should have updated the primary Kubernetes dependencies, but in case it didn't, you can do so manually:
6053
```
61-
go get k8s.io/api@v0.31.0 k8s.io/apimachinery@v0.31.0 k8s.io/client-go@v0.31.0 k8s.io/apiextensions-apiserver@v0.31.0
54+
go get k8s.io/api@v0.34.2 k8s.io/apimachinery@v0.34.2 k8s.io/client-go@v0.34.2 k8s.io/apiextensions-apiserver@v0.34.2 k8s.io/[email protected]
6255
```
63-
4. Run `go mod tidy`.
56+
3. Run `go mod tidy`.
6457
3. Run `hack/populate-copies.sh`, this will copy files originally copied
6558
from upstream over the local copies. Review the changes and ensure
66-
changes from upstream are handled.
59+
changes from upstream are handled. Its recommented to have clean branch
60+
for this as it will produce many changes, which most are "carry-on", so will require manual review.
6761
4. Run `make codegen`. You'll probably want to commit these changes as a standalone commit.
68-
5. Run `make lint` and fix any issues you encounter.
69-
6. Commit any remaining changes.
70-
7. Push to your fork.
71-
8. Open a PR; get it reviewed and merged.
62+
5. Commit your changes so we have a clean commits for each step.
7263
7364
# 4. Update kcp-dev/kubernetes
7465
@@ -106,7 +97,7 @@ Commits merged into `kcp-dev/kubernetes` follow this commit message format:
10697
5. Prepare a list of commits:
10798
1. Checkout the current fork branch:
10899
```
109-
git checkout kcp-dev/kcp-1.32.3
100+
git checkout kcp-dev/kcp-1.33.5
110101
```
111102
2. Export the commits to cherry-pick them:
112103
```
@@ -118,14 +109,22 @@ Commits merged into `kcp-dev/kubernetes` follow this commit message format:
118109
attention.
119110
6. Prepare a branch to cherry-pick the commits onto:
120111
```
121-
git reset --hard v1.33.3
112+
git reset --hard v1.34.2
113+
```
114+
7. Prepare base branch in kcp fork (you might need to ask maintainer to do this):
115+
1. Create a new branch in kcp-dev/kubernetes fork, e.g. `kcp-1.34-baseline`, based off `v1.34.2` in
116+
`kcp-dev/kubernetes`.
117+
2. Push the new branch to kcp fork in GitHub.
118+
8. Set up your local repo to point to the new baseline branch and prepare to cherry-pick:
119+
```
120+
git checkout -b kcp-1.34.2-pre.1
122121
```
123122
124123
Note: To make validating changes easier you can use these functions:
125124
126125
```bash
127126
# record the changed files between the version kcp will jump
128-
git diff --name-only v1.32.3 v1.33.3 > ../changed_files.txt
127+
git diff --name-only v1.33.5 v1.34.2 > changed_files.txt
129128
130129
# list_changed_files lists the files changed in the current commit
131130
list_changed_files() {
@@ -229,6 +228,8 @@ two kube versions.
229228
230229
# 5. Update kcp-dev/kcp
231230
231+
If you want to test this before pushing - you can use `go.work` to point to your local copy of kcp-dev/kubernetes and test.
232+
232233
1. At this point, you're ready to try to integrate the updates into kcp proper. There is still likely a good
233234
amount of work to do, so don't get discouraged if you encounter dozens or hundreds of compilation issues at
234235
this point. That's totally normal!

0 commit comments

Comments
 (0)