mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-04 10:41:27 +02:00
finish PR1544
This commit is contained in:
@@ -721,6 +721,11 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
|
||||
Type: "string",
|
||||
},
|
||||
},
|
||||
OneOf: []apiextv1.JSONSchemaProps{
|
||||
apiextv1.JSONSchemaProps{Required: []string{"s3_wal_path"}},
|
||||
apiextv1.JSONSchemaProps{Required: []string{"gs_wal_path"}},
|
||||
apiextv1.JSONSchemaProps{Required: []string{"standby_host"}},
|
||||
},
|
||||
},
|
||||
"streams": {
|
||||
Type: "array",
|
||||
|
||||
@@ -172,8 +172,8 @@ type Patroni struct {
|
||||
|
||||
// StandbyDescription contains remote primary config or s3 wal path
|
||||
type StandbyDescription struct {
|
||||
S3WalPath string `json:"s3_wal_path,omitempty"`
|
||||
GSWalPath string `json:"gs_wal_path,omitempty"`
|
||||
S3WalPath string `json:"s3_wal_path,omitempty"`
|
||||
GSWalPath string `json:"gs_wal_path,omitempty"`
|
||||
StandbyHost string `json:"standby_host,omitempty"`
|
||||
StandbyPort string `json:"standby_port,omitempty"`
|
||||
}
|
||||
|
||||
@@ -762,7 +762,12 @@ func (c *Cluster) generatePodTemplate(
|
||||
}
|
||||
|
||||
// generatePodEnvVars generates environment variables for the Spilo Pod
|
||||
func (c *Cluster) generateSpiloPodEnvVars(uid types.UID, spiloConfiguration string, cloneDescription *acidv1.CloneDescription, standbyDescription *acidv1.StandbyDescription, customPodEnvVarsList []v1.EnvVar) []v1.EnvVar {
|
||||
func (c *Cluster) generateSpiloPodEnvVars(
|
||||
uid types.UID,
|
||||
spiloConfiguration string,
|
||||
cloneDescription *acidv1.CloneDescription,
|
||||
standbyDescription *acidv1.StandbyDescription,
|
||||
customPodEnvVarsList []v1.EnvVar) []v1.EnvVar {
|
||||
envVars := []v1.EnvVar{
|
||||
{
|
||||
Name: "SCOPE",
|
||||
@@ -1111,12 +1116,6 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
|
||||
sort.Slice(customPodEnvVarsList,
|
||||
func(i, j int) bool { return customPodEnvVarsList[i].Name < customPodEnvVarsList[j].Name })
|
||||
|
||||
if spec.StandbyCluster != nil {
|
||||
if spec.StandbyCluster.S3WalPath == "" && spec.StandbyCluster.GSWalPath == "" && spec.StandbyCluster.StandbyHost == "" {
|
||||
return nil, fmt.Errorf("s3_wal_path, gs_wal_path and standby_host are empty for standby cluster")
|
||||
}
|
||||
}
|
||||
|
||||
// backward compatible check for InitContainers
|
||||
if spec.InitContainersOld != nil {
|
||||
msg := "manifest parameter init_containers is deprecated."
|
||||
|
||||
Reference in New Issue
Block a user