(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestGenerateInstance(t *testing.T) { |
| 267 | cluster := &v1beta1.PostgresCluster{ |
| 268 | ObjectMeta: metav1.ObjectMeta{ |
| 269 | Namespace: "ns1", Name: "pg0", |
| 270 | }, |
| 271 | } |
| 272 | set := &v1beta1.PostgresInstanceSetSpec{Name: "hippos"} |
| 273 | |
| 274 | instance := GenerateInstance(cluster, set) |
| 275 | |
| 276 | assert.Equal(t, cluster.Namespace, instance.Namespace) |
| 277 | assert.Assert(t, strings.HasPrefix(instance.Name, cluster.Name+"-"+set.Name+"-")) |
| 278 | } |
| 279 | |
| 280 | // TestGenerateStartupInstance ensures that a consistent ObjectMeta will be |
| 281 | // provided assuming the same cluster name and instance set name is passed |
nothing calls this directly
no test coverage detected