Skip to content

Commit c627d62

Browse files
Casey Callendrellohasbro17
authored andcommitted
doc/migration: Tweak client examples, add unstructured (#693)
1 parent ee6eee6 commit c627d62

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/migration/v0.1.0-migration-guide.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,20 @@ See the examples below and the controller-runtime [client API doc][client-api-do
208208
```Go
209209
// Create
210210
dep := &appsv1.Deployment{...}
211-
err := sdk.Create(dep)
212211
// v0.0.1
212+
err := sdk.Create(dep)
213+
// v0.1.0
213214
err := r.client.Create(context.TODO(), dep)
214215
215216
// Update
217+
// v0.1.0
216218
err := sdk.Update(dep)
217-
// v0.0.1
219+
// v0.1.0
218220
err := r.client.Update(context.TODO(), dep)
219221
220222
// Delete
221223
err := sdk.Delete(dep)
222-
// v0.0.1
224+
// v0.1.0
223225
err := r.client.Delete(context.TODO(), dep)
224226
225227
// List
@@ -237,6 +239,10 @@ err := sdk.Get(dep)
237239
// v0.1.0
238240
dep := &appsv1.Deployment{}
239241
err = r.client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: namespace}, dep)
242+
// v0.1.0 with unstructured
243+
dep := &unstructured.Unstructured{}
244+
dep.SetGroupVersionKind(schema.GroupVersionKind{Group:"apps", Version: "v1", Kind:"Deployment"})
245+
err = r.client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: namespace}, dep)
240246
```
241247
242248
Lastly copy and initialize any other fields that you may have had in your `Handler` struct into the `Reconcile<Kind>` struct:

0 commit comments

Comments
 (0)