createClusterPodSpec computes the PodSpec corresponding to a cluster
( podName string, cluster apiv1.Cluster, envConfig EnvConfig, gracePeriod int64, enableHTTPS bool, )
| 182 | |
| 183 | // createClusterPodSpec computes the PodSpec corresponding to a cluster |
| 184 | func createClusterPodSpec( |
| 185 | podName string, |
| 186 | cluster apiv1.Cluster, |
| 187 | envConfig EnvConfig, |
| 188 | gracePeriod int64, |
| 189 | enableHTTPS bool, |
| 190 | ) corev1.PodSpec { |
| 191 | return corev1.PodSpec{ |
| 192 | Hostname: podName, |
| 193 | InitContainers: []corev1.Container{ |
| 194 | createBootstrapContainer(cluster, getExtensions(&cluster)), |
| 195 | }, |
| 196 | SchedulerName: cluster.Spec.SchedulerName, |
| 197 | Containers: createPostgresContainers(cluster, envConfig, enableHTTPS), |
| 198 | Volumes: createPostgresVolumes(&cluster, podName, getExtensions(&cluster)), |
| 199 | SecurityContext: GetPodSecurityContext(&cluster), |
| 200 | Affinity: CreateAffinitySection(cluster.Name, cluster.Spec.Affinity), |
| 201 | Tolerations: cluster.Spec.Affinity.Tolerations, |
| 202 | ServiceAccountName: cluster.GetServiceAccountName(), |
| 203 | NodeSelector: cluster.Spec.Affinity.NodeSelector, |
| 204 | TerminationGracePeriodSeconds: &gracePeriod, |
| 205 | TopologySpreadConstraints: cluster.Spec.TopologySpreadConstraints, |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | // createPostgresContainers create the PostgreSQL containers that are |
| 210 | // used for every instance |
no test coverage detected