MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / Add

Method Add

internal/controller/runtime/patch.go:51–65  ·  view source on GitHub ↗

Add appends an "add" operation to patch. > The "add" operation performs one of the following functions, > depending upon what the target location references: > > o If the target location specifies an array index, a new value is > inserted into the array at the specified index. > > o If the tar

(path ...string)

Source from the content-addressed store, hash-verified

49// > o If the target location specifies an object member that does exist,
50// > that member's value is replaced.
51func (patch *JSON6902) Add(path ...string) func(value any) *JSON6902 {
52 i := len(*patch)
53 f := func(value any) *JSON6902 {
54 (*patch)[i] = map[string]any{
55 "op": "add",
56 "path": patch.pointer(path...),
57 "value": value,
58 }
59 return patch
60 }
61
62 *patch = append(*patch, f)
63
64 return f
65}
66
67// Remove appends a "remove" operation to patch.
68//

Callers 10

watchPodsMethod · 0.45
adoptObjectMethod · 0.45
releaseObjectMethod · 0.45
TestJSON6902Function · 0.45
TestMerge7386Function · 0.45
TestMerge7386EquivalenceFunction · 0.45
PostgreSQLParametersFunction · 0.45

Calls 1

pointerMethod · 0.95

Tested by 5

TestJSON6902Function · 0.36
TestMerge7386Function · 0.36
TestMerge7386EquivalenceFunction · 0.36