From 59a214727ce6fbb59257330873b7bf67b29f5697 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Thu, 1 Mar 2018 12:26:09 +0100 Subject: [PATCH] Fix clone for origins in non-default namespaces. By default, spilo sets WAL_BUCKET_SCOPE_PREFIX depending on the cluster namespace, possibly to a non-empty string. However, we won't be able to clone those clusters, as the clone prefix is always set to an empty string. We could go the other way around and set both WAL_BUCKET_SCOPE_PREFIX and CLONE_WAL_BUCKET_SCOPE_PREFIX to a non-default value that depends on the cluster's namespace, but it seems that we don't need this feature for now (no conflict will occur even for clusters with the same name and different namespaces because of the SCOPE_SUFFIX) and it requires some additional testing first. --- pkg/cluster/k8sres.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index 2cd956950..35d67463f 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -361,6 +361,7 @@ func (c *Cluster) generatePodTemplate( if c.OpConfig.WALES3Bucket != "" { envVars = append(envVars, v1.EnvVar{Name: "WAL_S3_BUCKET", Value: c.OpConfig.WALES3Bucket}) envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_SUFFIX", Value: getWALBucketScopeSuffix(string(uid))}) + envVars = append(envVars, v1.EnvVar{Name: "WAL_BUCKET_SCOPE_PREFIX", Value: ""}) } if c.patroniUsesKubernetes() {