MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / newFakeNamespace

Function newFakeNamespace

internal/controller/suite_test.go:296–310  ·  view source on GitHub ↗
(k8sClient client.Client)

Source from the content-addressed store, hash-verified

294}
295
296func newFakeNamespace(k8sClient client.Client) string {
297 name := rand.String(10)
298
299 namespace := &corev1.Namespace{
300 TypeMeta: metav1.TypeMeta{},
301 ObjectMeta: metav1.ObjectMeta{
302 Name: name,
303 Namespace: name,
304 },
305 }
306 err := k8sClient.Create(context.Background(), namespace)
307 Expect(err).ToNot(HaveOccurred())
308
309 return name
310}
311
312func getPoolerDeployment(ctx context.Context, k8sClient client.Client, pooler *apiv1.Pooler) *appsv1.Deployment {
313 deployment := &appsv1.Deployment{}

Calls 2

CreateMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected