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

Function createFakeCluster

pkg/postgres/replication/suite_test.go:37–53  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

35}
36
37func createFakeCluster(name string) *apiv1.Cluster {
38 primaryPod := fmt.Sprintf("%s-1", name)
39 cluster := &apiv1.Cluster{}
40 cluster.Name = name
41 cluster.Default()
42 cluster.Spec.Instances = 3
43 cluster.Spec.MaxSyncReplicas = 2
44 cluster.Spec.MinSyncReplicas = 1
45 cluster.Status = apiv1.ClusterStatus{
46 CurrentPrimary: primaryPod,
47 InstancesStatus: map[apiv1.PodStatus][]string{
48 apiv1.PodHealthy: {primaryPod, fmt.Sprintf("%s-2", name), fmt.Sprintf("%s-3", name)},
49 apiv1.PodFailed: {},
50 },
51 }
52 return cluster
53}

Callers 2

explicit_test.goFile · 0.85
legacy_test.goFile · 0.85

Calls 1

DefaultMethod · 0.95

Tested by

no test coverage detected