Skip to content

Commit 535677e

Browse files
authored
Update migration_guide.md
1 parent cbd2925 commit 535677e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/migration_guide.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This document describes how to migrate a project created by kubebuilder v0 to a
55
The recommended way of migrating a v0 project to a v1 project is to create a new v1 project and copy/modify the code from v0 project to it.
66

77
## Init a v1 project
8-
Find project's domain name from the old project's pkg/apis/doc.go and use it to initiate a new project with
8+
Find the project's domain name from the old project's pkg/apis/doc.go and use it to initiate a new project with
99
`kubebuilder init --project-version v1 --domain <domain>`
1010

1111
## Create api
@@ -18,7 +18,7 @@ If there are several resources in the old project, repeat the `kubebuilder creat
1818

1919
## Copy types.go
2020
Copy the content of `<type>_types.go` from the old project into the file `<type>_types.go` in the new project.
21-
Note that in the v1 project, there is a section containing `<type>List` and `init` function. Please keep this section.
21+
Note that in the v1 project, there is a section containing `<type>List` and `init` functions. Please keep this section.
2222
```
2323
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
2424
// +genclient:nonNamespaced
@@ -90,7 +90,7 @@ err = r.Client.List(context.TODO(), &client.ListOptions{LabelSelector: labelSele
9090

9191
### update add function
9292

93-
In a v0 project controller file, there is a `ProvideController` function creating a controller and adding some watches. In v1 projects, the corresponding function is `add`. For this part, you don't need to copy any code from v0 project to v1 project. You need to add some watchers in v1 project's `add` function based on what `watch` functions are called in v0 project's `ProvideController` function.
93+
In a v0 project controller file, there is a `ProvideController` function creating a controller and adding some watches. In v1 projects, the corresponding function is `add`. For this part, you don't need to copy any code from the v0 project to v1 project. You need to add some watchers in the v1 project's `add` function based on what `watch` functions are called in the v0 project's `ProvideController` function.
9494

9595
Here are several examples:
9696

@@ -112,14 +112,14 @@ c.Watch(&source.Kind{Type: &appsv1.Deployment{}}, &handler.EnqueueRequestForOwne
112112
```
113113

114114
### copy other functions
115-
If `reconcile` function depends on some other user defined functions, copy those function as well into the v1 project.
115+
If the `reconcile` function depends on some other user-defined functions, copy those functions as well into the v1 project.
116116

117117
## Copy user libraries
118-
If there are some user defined libraries in the old project, make sure to copy them as well into the new project.
118+
If there are some user-defined libraries in the old project, make sure to copy them as well into the new project.
119119

120120
## Update dependency
121121

122-
Open the Gopkg.toml file in the old project and find if there is user defined dependency in this block:
122+
Open the Gopkg.toml file in the old project and find if there is user-defined dependency in this block:
123123

124124
```
125125
# Users add deps lines here
@@ -139,8 +139,8 @@ Copy those dependencies into the new project's Gopkg.toml file **before** the li
139139
```
140140

141141
## Copy other user files
142-
If there are other user created files in the old project, such as any build scripts, README.md files. Copy those files into the new project.
142+
If there are other user-created files in the old project, such as any build scripts, or README.md files. Copy those files into the new project.
143143

144144
## Confirmation
145-
Run `make` to make sure the new project can build and pass all the tests.
145+
Run `make` to make sure the new project can be built and pass all the tests.
146146
Run `make install` and `make run` to make sure the api and controller work well on cluster.

0 commit comments

Comments
 (0)