MCPcopy
hub / github.com/kubernetes-sigs/controller-runtime / MergeFromWithOptions

Function MergeFromWithOptions

pkg/client/patch.go:158–164  ·  view source on GitHub ↗

MergeFromWithOptions creates a Patch that patches using the merge-patch strategy with the given object as base. See MergeFrom for more details.

(obj Object, opts ...MergeFromOption)

Source from the content-addressed store, hash-verified

156// MergeFromWithOptions creates a Patch that patches using the merge-patch strategy with the given object as base.
157// See MergeFrom for more details.
158func MergeFromWithOptions(obj Object, opts ...MergeFromOption) Patch {
159 options := &MergeFromOptions{}
160 for _, opt := range opts {
161 opt.ApplyToMergeFrom(options)
162 }
163 return &mergeFromPatch{patchType: types.MergePatchType, createPatch: createMergePatch, from: obj, opts: *options}
164}
165
166// StrategicMergeFrom creates a Patch that patches using the strategic-merge-patch strategy with the given object as base.
167// The difference between MergeFrom and StrategicMergeFrom lays in the handling of modified list fields.

Callers 2

client_test.goFile · 0.92
BenchmarkMergeFromFunction · 0.85

Calls 1

ApplyToMergeFromMethod · 0.65

Tested by 1

BenchmarkMergeFromFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…