MCPcopy Create free account
hub / github.com/flant/shell-operator / ExecuteOperation

Method ExecuteOperation

pkg/kube/object_patch/patch.go:62–81  ·  view source on GitHub ↗
(operation sdkpkg.PatchCollectorOperation)

Source from the content-addressed store, hash-verified

60}
61
62func (o *ObjectPatcher) ExecuteOperation(operation sdkpkg.PatchCollectorOperation) error {
63 if operation == nil {
64 return nil
65 }
66
67 switch v := operation.(type) {
68 case *createOperation:
69 return o.executeCreateOperation(v)
70 case *deleteOperation:
71 return o.executeDeleteOperation(v)
72 case *patchOperation:
73 if v.hasFilterFn() {
74 return o.executeFilterOperation(v)
75 }
76
77 return o.executePatchOperation(v)
78 }
79
80 return nil
81}
82
83func (o *ObjectPatcher) executeCreateOperation(op *createOperation) error {
84 if op.object == nil {

Callers 8

Test_PatchOperationsFunction · 0.95
Test_CreateOperationsFunction · 0.95
Test_DeleteOperationsFunction · 0.95
ExecuteOperationsMethod · 0.95
ensureNamespaceFunction · 0.80
ensureTestObjectFunction · 0.80
removeNamespaceFunction · 0.80

Calls 5

executePatchOperationMethod · 0.95
hasFilterFnMethod · 0.80

Tested by 6

Test_PatchOperationsFunction · 0.76
Test_CreateOperationsFunction · 0.76
Test_DeleteOperationsFunction · 0.76
ensureNamespaceFunction · 0.64
ensureTestObjectFunction · 0.64
removeNamespaceFunction · 0.64