MCPcopy Index your code
hub / github.com/cloudnative-pg/cloudnative-pg / Create

Function Create

tests/utils/objects/objects.go:41–58  ·  view source on GitHub ↗

Create creates object in the Kubernetes cluster

(
	ctx context.Context,
	crudClient client.Client,
	object client.Object,
	opts ...client.CreateOption,
)

Source from the content-addressed store, hash-verified

39
40// Create creates object in the Kubernetes cluster
41func Create(
42 ctx context.Context,
43 crudClient client.Client,
44 object client.Object,
45 opts ...client.CreateOption,
46) (client.Object, error) {
47 err := retry.New(
48 retry.Delay(PollingTime*time.Second),
49 retry.Attempts(RetryAttempts),
50 retry.DelayType(retry.FixedDelay),
51 retry.RetryIf(func(err error) bool { return !errors.IsAlreadyExists(err) })).
52 Do(
53 func() error {
54 return crudClient.Create(ctx, object, opts...)
55 },
56 )
57 return object, err
58}
59
60// Delete deletes an object in the Kubernetes cluster
61func Delete(

Callers 15

ImportDatabasesMonolithFunction · 0.92
CreateSecretCAFunction · 0.92
CreateNamespaceFunction · 0.92
isWebhookWorkingFunction · 0.92
CreateConfigMapFunction · 0.92
CreateSubscriptionFunction · 0.92
CreateFunction · 0.92

Calls 1

CreateMethod · 0.65

Tested by

no test coverage detected