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

Function newCreateOperation

pkg/kube/object_patch/operation.go:263–278  ·  view source on GitHub ↗
(operation OperationType, obj any)

Source from the content-addressed store, hash-verified

261}
262
263func newCreateOperation(operation OperationType, obj any) sdkpkg.PatchCollectorOperation {
264 op := &createOperation{
265 object: obj,
266 }
267
268 switch operation {
269 case Create:
270 // pass
271 case CreateOrUpdate:
272 op.updateIfExists = true
273 case CreateIfNotExists:
274 op.ignoreIfExists = true
275 }
276
277 return op
278}
279
280func NewDeleteOperation(apiVersion string, kind string, namespace string, name string) sdkpkg.PatchCollectorOperation {
281 return newDeleteOperation(metav1.DeletePropagationForeground, apiVersion, kind, namespace, name)

Callers 3

NewCreateOperationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected