Skip to content

Commit a506412

Browse files
Add Status when adopting resource (#47)
`r.kc.Create()` does not add the `Status` fields from `ReadOne` to the newly created resource. Some resources (like SageMaker's `ModelPackage`) require these resource fields as their identifier for the `ReadOne` call. It is necessary to patch the `Status` fields so the consequent update loop is able to find the resource.
1 parent 7fbba5c commit a506412

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/runtime/adoption_reconciler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ func (r *adoptionReconciler) sync(
216216
return r.onError(ctx, desired, err)
217217
}
218218

219+
if err := r.kc.Status().Update(ctx, described.RuntimeObject()); err != nil {
220+
return r.onError(ctx, desired, err)
221+
}
222+
219223
if err := r.markManaged(ctx, *desired); err != nil {
220224
return r.onError(ctx, desired, err)
221225
}

0 commit comments

Comments
 (0)