( c client.Client, cluster *apiv1.Cluster, serial int, status persistentvolumeclaim.PVCStatus, )
| 396 | } |
| 397 | |
| 398 | func newFakePVC( |
| 399 | c client.Client, |
| 400 | cluster *apiv1.Cluster, |
| 401 | serial int, |
| 402 | status persistentvolumeclaim.PVCStatus, |
| 403 | ) []corev1.PersistentVolumeClaim { |
| 404 | var pvcGroup []corev1.PersistentVolumeClaim |
| 405 | pvc, err := persistentvolumeclaim.Build( |
| 406 | cluster, |
| 407 | &persistentvolumeclaim.CreateConfiguration{ |
| 408 | Status: status, |
| 409 | NodeSerial: serial, |
| 410 | Calculator: persistentvolumeclaim.NewPgDataCalculator(), |
| 411 | Storage: cluster.Spec.StorageConfiguration, |
| 412 | }) |
| 413 | Expect(err).ToNot(HaveOccurred()) |
| 414 | cluster.SetInheritedDataAndOwnership(&pvc.ObjectMeta) |
| 415 | |
| 416 | err = c.Create(context.Background(), pvc) |
| 417 | Expect(err).ToNot(HaveOccurred()) |
| 418 | pvcGroup = append(pvcGroup, *pvc) |
| 419 | |
| 420 | if cluster.ShouldCreateWalArchiveVolume() { |
| 421 | pvcWal, err := persistentvolumeclaim.Build( |
| 422 | cluster, |
| 423 | &persistentvolumeclaim.CreateConfiguration{ |
| 424 | Status: status, |
| 425 | NodeSerial: serial, |
| 426 | Calculator: persistentvolumeclaim.NewPgWalCalculator(), |
| 427 | Storage: cluster.Spec.StorageConfiguration, |
| 428 | }, |
| 429 | ) |
| 430 | Expect(err).ToNot(HaveOccurred()) |
| 431 | cluster.SetInheritedDataAndOwnership(&pvcWal.ObjectMeta) |
| 432 | err = c.Create(context.Background(), pvcWal) |
| 433 | Expect(err).ToNot(HaveOccurred()) |
| 434 | pvcGroup = append(pvcGroup, *pvcWal) |
| 435 | } |
| 436 | |
| 437 | return pvcGroup |
| 438 | } |
| 439 | |
| 440 | // generateFakeCASecret follows the conventions established by cert.GenerateCASecret |
| 441 | func generateFakeCASecret(c client.Client, name, namespace, domain string) (*corev1.Secret, *certs.KeyPair) { |
no test coverage detected