Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/runtime/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ func (r *resourceReconciler) patchResourceMetadataAndSpec(
}

rlog.Enter("kc.Patch (metadata + spec)")
// It is necessary to use `DeepCopyObject` versions of `latest` when calling
// `Patch` as this method overrides all values as merged from `desired`.
// This may affect `latest` in later execution, as otherwise this would set
//`desired` == `latest` after calling this method.
err = r.kc.Patch(
ctx,
latest.RuntimeObject().DeepCopyObject(),
Expand Down Expand Up @@ -373,6 +377,10 @@ func (r *resourceReconciler) patchResourceStatus(
return nil
}
rlog.Enter("kc.Patch (status)")
// It is necessary to use `DeepCopyObject` versions of `latest` when calling
// `Patch` as this method overrides all values as merged from `desired`.
// This may affect `latest` in later execution, as otherwise this would set
//`desired` == `latest` after calling this method.
err = r.kc.Status().Patch(
ctx,
latest.RuntimeObject().DeepCopyObject(),
Expand Down