@@ -1040,8 +1040,8 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
10401040 sort .Slice (customPodEnvVarsList ,
10411041 func (i , j int ) bool { return customPodEnvVarsList [i ].Name < customPodEnvVarsList [j ].Name })
10421042
1043- if spec .StandbyCluster != nil && spec .StandbyCluster .S3WalPath == "" {
1044- return nil , fmt .Errorf ("s3_wal_path is empty for standby cluster" )
1043+ if spec .StandbyCluster != nil && spec .StandbyCluster .S3WalPath == "" && spec . StandbyCluster . GSWalPath == "" {
1044+ return nil , fmt .Errorf ("s3_wal_path and s3_wal_path are empty for standby cluster" )
10451045 }
10461046
10471047 // backward compatible check for InitContainers
@@ -1808,17 +1808,29 @@ func (c *Cluster) generateCloneEnvironment(description *acidv1.CloneDescription)
18081808func (c * Cluster ) generateStandbyEnvironment (description * acidv1.StandbyDescription ) []v1.EnvVar {
18091809 result := make ([]v1.EnvVar , 0 )
18101810
1811- if description .S3WalPath == "" {
1811+ if description .S3WalPath != "" {
1812+ // standby with S3, find out the bucket to setup standby
1813+ msg := "Standby from S3 bucket using custom parsed S3WalPath from the manifest %s "
1814+ c .logger .Infof (msg , description .S3WalPath )
1815+
1816+ result = append (result , v1.EnvVar {
1817+ Name : "STANDBY_WALE_S3_PREFIX" ,
1818+ Value : description .S3WalPath ,
1819+ })
1820+
1821+ } else if description .GSWalPath != "" {
1822+ // standby with GS, find out the bucket to setup standby
1823+ msg := "Standby from GS bucket using custom parsed GSWalPath from the manifest %s "
1824+ c .logger .Infof (msg , description .GSWalPath )
1825+
1826+ result = append (result , v1.EnvVar {
1827+ Name : "STANDBY_WALE_GS_PREFIX" ,
1828+ Value : description .GSWalPath ,
1829+ })
1830+
1831+ } else {
18121832 return nil
18131833 }
1814- // standby with S3, find out the bucket to setup standby
1815- msg := "Standby from S3 bucket using custom parsed S3WalPath from the manifest %s "
1816- c .logger .Infof (msg , description .S3WalPath )
1817-
1818- result = append (result , v1.EnvVar {
1819- Name : "STANDBY_WALE_S3_PREFIX" ,
1820- Value : description .S3WalPath ,
1821- })
18221834
18231835 result = append (result , v1.EnvVar {Name : "STANDBY_METHOD" , Value : "STANDBY_WITH_WALE" })
18241836 result = append (result , v1.EnvVar {Name : "STANDBY_WAL_BUCKET_SCOPE_PREFIX" , Value : "" })
0 commit comments