kubebuilder-updates

Upgrade your kubebuilder project by applying patch

Stars
5

kubebuilder-updates scaffold

This repository contains the scaffold code generated by the latest versions of kubebuilder. It is continuously updated by Renovate and GitHub Actions.

How to upgrade a project

You can upgrade a project using the patches of this repository.

Upgrade from kubebuilder v4.1.1 to v4.2.0

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/117/commits/d04a0b20290cd8d43273f33c4c4eb0e12ff3e995,

# Fetch the diff
git fetch https://github.com/int128/kubebuilder-updates d04a0b20290cd8d43273f33c4c4eb0e12ff3e995

# Apply the patch
git checkout -b upgrade-kubebuilder-v4.2.0
git cherry-pick d04a0b20290cd8d43273f33c4c4eb0e12ff3e995

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v4.1.1 to v4.2.0'
gh pr create -f

Upgrade from kubebuilder v4.1.0 to v4.1.1

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/110/commits/14a2ab11c9cac933c5a55aaffc4385ad7d76a919,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 14a2ab11c9cac933c5a55aaffc4385ad7d76a919

# apply the patch
git checkout -b upgrade-kubebuilder-v4.1.1
git cherry-pick 14a2ab11c9cac933c5a55aaffc4385ad7d76a919

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v4.1.0 to v4.1.1'
gh pr create -f

Upgrade from kubebuilder v4.0.0 to v4.1.0

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/103/commits/6c8c9e389861d24433fe14c382bc81254812e65e,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 6c8c9e389861d24433fe14c382bc81254812e65e

# apply the patch
git checkout -b upgrade-kubebuilder-v4.1.0
git cherry-pick 6c8c9e389861d24433fe14c382bc81254812e65e

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v4.0.0 to v4.1.0'
gh pr create -f

Upgrade from kubebuilder v3.15.1 to v4.0.0

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/88/commits/f7406cbb4ac76ab4d12b6b5465c5f061fc1e02bc,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates f7406cbb4ac76ab4d12b6b5465c5f061fc1e02bc

# apply the patch
git checkout -b upgrade-kubebuilder-v4.0.0
git cherry-pick f7406cbb4ac76ab4d12b6b5465c5f061fc1e02bc

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.15.1 to v4.0.0'
gh pr create -f

Upgrade from kubebuilder v3.14.2 to v3.15.1

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/78/commits/3f6ba8e08f85f46dce1e7d5e492e7f7867ff2960,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 3f6ba8e08f85f46dce1e7d5e492e7f7867ff2960

# apply the patch
git checkout -b upgrade-kubebuilder-v3.15.1
git cherry-pick 3f6ba8e08f85f46dce1e7d5e492e7f7867ff2960

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.14.2 to v3.15.1'
gh pr create -f

Upgrade from kubebuilder v3.13.0 to v3.14.2

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/91/commits/c8557394e1fcde80414693650806199b837d5f0b,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates c8557394e1fcde80414693650806199b837d5f0b

# apply the patch
git checkout -b upgrade-kubebuilder-v3.14.2
git cherry-pick c8557394e1fcde80414693650806199b837d5f0b

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.13.0 to v3.14.2'
gh pr create -f

Upgrade from kubebuilder v3.12.0 to v3.13.0

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/66/commits/5bb7ed877d129a4afc28136a0a64d5067753ba83,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 5bb7ed877d129a4afc28136a0a64d5067753ba83

# apply the patch
git checkout -b upgrade-kubebuilder-v3.13.0
git cherry-pick 5bb7ed877d129a4afc28136a0a64d5067753ba83

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.12.0 to v3.13.0'
gh pr create -f

Upgrade from kubebuilder v3.11.1 to v3.12.0

To apply the patch of https://github.com/int128/kubebuilder-updates/pull/56/commits/e503579de20924f51d2d5970346044cf29e43ab7,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates e503579de20924f51d2d5970346044cf29e43ab7

# apply the patch
git checkout -b upgrade-kubebuilder-v3.12.0
git cherry-pick e503579de20924f51d2d5970346044cf29e43ab7

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.11.1 to v3.12.0'
gh pr create -f

Upgrade from kubebuilder v3.11.0 to v3.11.1

See the diff from https://github.com/int128/kubebuilder-updates/pull/47/commits/8eeb003e4d95440ff42b2df7c15b136023d5ec25

To apply the patches to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 8eeb003e4d95440ff42b2df7c15b136023d5ec25

# apply the patch
git checkout -b upgrade-kubebuilder-v3.11.1
git cherry-pick 8eeb003e4d95440ff42b2df7c15b136023d5ec25

You may need to resolve conflicts.

See also the breaking changes from https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.15.0.

git commit -m 'Upgrade from kubebuilder v3.11.0 to v3.11.1'
gh pr create -f

Upgrade from kubebuilder v3.10.0 to v3.11.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/46/commits/68121dd3a586fd9e8fb2c1063075176b6a3d111e.

To apply the patches to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 68121dd3a586fd9e8fb2c1063075176b6a3d111e

# apply the patch
git checkout -b upgrade-kubebuilder-v3.11.0
git cherry-pick 68121dd3a586fd9e8fb2c1063075176b6a3d111e

# remove samples
git rm config/crd/bases/webapp.int128.github.io_guestbooks.yaml
git rm internal/controller/guestbook_controller.go

# exclude go deps
git reset -- go.mod go.sum
git checkout -- go.mod go.sum

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.10.0 to v3.11.0'
gh pr create -f

Upgrade from kubebuilder v3.9.0 to v3.10.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/38/commits/a27a7e31065143cd59fc85dd65185050430e0572.

To apply the patch to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates a27a7e31065143cd59fc85dd65185050430e0572

# apply the patch
git checkout -b upgrade-kubebuilder-v3.10.0
git cherry-pick a27a7e31065143cd59fc85dd65185050430e0572

# remove samples
git rm config/crd/bases/webapp.int128.github.io_guestbooks.yaml
git rm internal/controller/guestbook_controller.go

# exclude go deps
git reset -- go.mod go.sum
git checkout -- go.mod go.sum

You need to resolve conflicts, e.g.,

  • Move controllers -> internal/controller
  • Rename package controllers -> controller
  • Project Layout is changed to go.kubebuilder.io/v4

See https://book.kubebuilder.io/migration/manually_migration_guide_gov3_to_gov4.html for details.

git commit -m 'Upgrade from kubebuilder v3.9.0 to v3.10.0'
gh pr create -f

Upgrade from kubebuilder v3.8.0 to v3.9.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/21/commits/262e86755e5382e6bc2ea0666da622a764112416.

To apply the patch to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 262e86755e5382e6bc2ea0666da622a764112416

# apply the patch
git checkout -b upgrade-kubebuilder-v3.9.0
git cherry-pick 262e86755e5382e6bc2ea0666da622a764112416

# remove samples
git rm config/crd/bases/webapp.int128.github.io_guestbooks.yaml
git rm controllers/guestbook_controller.go

# exclude go deps
git reset -- go.mod go.sum
git checkout -- go.mod go.sum

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.8.0 to v3.9.0'
gh pr create -f

Upgrade from kubebuilder v3.7.0 to v3.8.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/10/commits/eb5b02fb29ba1d15f5655447077e3d7af8fd1423.

To apply the patch to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates eb5b02fb29ba1d15f5655447077e3d7af8fd1423

# apply the patch
git checkout -b upgrade-kubebuilder-v3.8.0
git cherry-pick eb5b02fb29ba1d15f5655447077e3d7af8fd1423

# remove samples
git rm config/crd/bases/webapp.int128.github.io_guestbooks.yaml
git rm controllers/guestbook_controller.go

# exclude go deps
git reset -- go.mod go.sum
git checkout -- go.mod go.sum

You may need to resolve conflicts.

git commit -m 'Upgrade from kubebuilder v3.7.0 to v3.8.0'
gh pr create -f

Upgrade from kubebuilder v3.6.0 to v3.7.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/6/commits/15afba8bb4201076ea09a4761b1525185fa4ede0

To apply the patch to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates 15afba8bb4201076ea09a4761b1525185fa4ede0

# apply the patch
git checkout -b upgrade-kubebuilder-v3.7.0
git cherry-pick 15afba8bb4201076ea09a4761b1525185fa4ede0

# remove samples
git rm config/samples/webapp_v1_guestbook.yaml
git rm controllers/guestbook_controller.go

You may need to resolve conflicts.

Ginkgo v2

You need to replace github.com/onsi/ginkgo with github.com/onsi/ginkgo/v2. Run go mod tidy and make sure all imports have been replaced.

Resource labels

Since v3.7.0, the metadata labels are added to all resources. This patch contains an example name, so you need to replace kubebuilder-updates with your repository name.

    app.kubernetes.io/created-by: kubebuilder-updates
    app.kubernetes.io/part-of: kubebuilder-updates
    app.kubernetes.io/managed-by: kustomize

Upgrade from kubebuilder v3.5.0 to v3.6.0

See the diff from https://github.com/int128/kubebuilder-updates/pull/4/commits/e7921bbe47a5c309811c13441905af24b4a86dbe

To apply the patch to your repository,

# fetch the diff
git fetch https://github.com/int128/kubebuilder-updates e7921bbe47a5c309811c13441905af24b4a86dbe

# apply the patch
git checkout -b upgrade-kubebuilder-v3.6.0
git cherry-pick e7921bbe47a5c309811c13441905af24b4a86dbe

# remove samples
git rm config/samples/webapp_v1_guestbook.yaml
git rm controllers/guestbook_controller.go

You may need to resolve conflicts.