| 1 |
# Releasing kube-openapi into kubernetes/kubernetes |
| 2 |
|
| 3 |
kube-openapi is consumed by `kubernetes/kubernetes` (k/k) via Go modules. A |
| 4 |
"release" is a commit-pin bump of `k8s.io/kube-openapi` in k/k's `go.mod`, |
| 5 |
followed by regeneration of OpenAPI artifacts. |
| 6 |
|
| 7 |
Sample PR: https://github.com/kubernetes/kubernetes/pull/138931 |
| 8 |
|
| 9 |
Placeholders: |
| 10 |
- `<NEW-SHA>` — new kube-openapi commit to pin. Typically the latest commit on |
| 11 |
`master`: https://github.com/kubernetes/kube-openapi/commits/master |
| 12 |
- `<OLD-SHA>` — previous pin (read from the `k8s.io/kube-openapi` version |
| 13 |
string in k/k `go.mod`; the trailing hex is the commit SHA). |
| 14 |
|
| 15 |
## Steps |
| 16 |
|
| 17 |
Run from the root of a k/k checkout: |
| 18 |
|
| 19 |
```bash |
| 20 |
# 1. Pin the new commit. Rewrites go.mod with the new kube-openapi version. |
| 21 |
hack/pin-dependency.sh k8s.io/kube-openapi <NEW-SHA> |
| 22 |
|
| 23 |
# 2. Rebuild vendor. Touches every staging go.mod/go.sum and vendor/. |
| 24 |
hack/update-vendor.sh |
| 25 |
|
| 26 |
# 3. Regenerate zz_generated.openapi.go files. |
| 27 |
hack/update-codegen.sh |
| 28 |
|
| 29 |
# 4. Regenerate api/openapi-spec/ (etcd must be in PATH, see hack/install-etcd.sh). |
| 30 |
hack/update-openapi-spec.sh |
| 31 |
``` |
| 32 |
|
| 33 |
## Commit split |
| 34 |
|
| 35 |
Land as two commits, in order: |
| 36 |
|
| 37 |
1. `Bump kube-openapi to <short-SHA>` |
| 38 |
2. `Regenerate OpenAPI` |
| 39 |
|
| 40 |
## PR |
| 41 |
|
| 42 |
Include a compare link in the PR description as the change list: |
| 43 |
|
| 44 |
``` |
| 45 |
https://github.com/kubernetes/kube-openapi/compare/<OLD-SHA>...<NEW-SHA> |
| 46 |
``` |
| 47 |
|