(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestInstancePod(t *testing.T) { |
| 64 | t.Parallel() |
| 65 | |
| 66 | ctx := context.Background() |
| 67 | cluster := new(v1beta1.PostgresCluster) |
| 68 | cluster.Default() |
| 69 | cluster.Spec.ImagePullPolicy = corev1.PullAlways |
| 70 | cluster.Spec.PostgresVersion = 11 |
| 71 | |
| 72 | parameters := NewParameters().Default |
| 73 | |
| 74 | dataVolume := new(corev1.PersistentVolumeClaim) |
| 75 | dataVolume.Name = "datavol" |
| 76 | |
| 77 | instance := new(v1beta1.PostgresInstanceSetSpec) |
| 78 | instance.Resources.Requests = corev1.ResourceList{"cpu": resource.MustParse("9m")} |
| 79 | instance.Sidecars = &v1beta1.InstanceSidecars{ |
| 80 | ReplicaCertCopy: &v1beta1.Sidecar{ |
| 81 | Resources: &corev1.ResourceRequirements{ |
| 82 | Requests: corev1.ResourceList{"cpu": resource.MustParse("21m")}, |
| 83 | }, |
| 84 | }, |
| 85 | } |
| 86 | |
| 87 | serverSecretProjection := &corev1.SecretProjection{ |
| 88 | LocalObjectReference: corev1.LocalObjectReference{Name: "srv-secret"}, |
| 89 | Items: []corev1.KeyToPath{ |
| 90 | { |
| 91 | Key: naming.ReplicationCert, |
| 92 | Path: naming.ReplicationCert, |
| 93 | }, |
| 94 | { |
| 95 | Key: naming.ReplicationPrivateKey, |
| 96 | Path: naming.ReplicationPrivateKey, |
| 97 | }, |
| 98 | { |
| 99 | Key: naming.ReplicationCACert, |
| 100 | Path: naming.ReplicationCACert, |
| 101 | }, |
| 102 | }, |
| 103 | } |
| 104 | |
| 105 | clientSecretProjection := &corev1.SecretProjection{ |
| 106 | LocalObjectReference: corev1.LocalObjectReference{Name: "repl-secret"}, |
| 107 | Items: []corev1.KeyToPath{ |
| 108 | { |
| 109 | Key: naming.ReplicationCert, |
| 110 | Path: naming.ReplicationCertPath, |
| 111 | }, |
| 112 | { |
| 113 | Key: naming.ReplicationPrivateKey, |
| 114 | Path: naming.ReplicationPrivateKeyPath, |
| 115 | }, |
| 116 | }, |
| 117 | } |
| 118 | |
| 119 | // without WAL volume nor WAL volume spec |
| 120 | pod := new(corev1.PodTemplateSpec) |
nothing calls this directly
no test coverage detected